I have two calls to chrome.storage.local.get()
. I need for these calls to finish before continuing executing the rest of the code (calling continueCode()
function) for my chrome extension, but I'm not sure how to do this, here is my code.
function getData() {
chrome.storage.local.get(['key'], function(result) {
if (Object.values(result)[0] != undefined) {
object1.innerHTML = Object.values(result)[0].val;
}
});
chrome.storage.local.get(['key2'], function(result) {
if (Object.values(result)[0] != undefined) {
object2.innerHTML = Object.values(result)[0].val;
}
});
continueCode();
}