chrome.storage.sync.get sync with outer level object, but inner object is not sync? chrome.storage.sync.get sync with outer level object, but inner object is not sync? google-chrome google-chrome

chrome.storage.sync.get sync with outer level object, but inner object is not sync?


I found a workaround for anyone who's interested. I wrapped the get call with a function and call that function and that solve the issue. As to why this solves the issue...I have no idea. Below is an example.

function getChromeStorage() {    chrome.storage.sync.get(settings, function(storage) {    // get stored values back;}getChromeStorage(); // calling it as a function solves the asynchronous issue