Call Storage API with callback?

Chrome has an option to provide a callback when using .set(), wondering if the same is possible with Plasmo's Storage API?
chrome.storage.sync.set({ products: aoProduct }, function () { console.log( "Added product ", oProduct, "to Chrome storage. New products: ", aoProduct ) resolve() })
5 Replies
hgil
hgilOP•16mo ago
I can work around it in this example, just wondering
lab
lab•16mo ago
the storage API is async by nature if you need callback, use .then but I would use async for these cases
hgil
hgilOP•16mo ago
Ok cool makes sense just checking thx @louisgv !
YAGPDB.xyz
YAGPDB.xyz•16mo ago
Gave +1 Rep to @louisgv
Arcane
Arcane•16mo ago
@hgil has reached level 2. GG!
Want results from more Discord servers?
Add your server