You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm interested in migrating over to this from https://github.com/tshaddix/webext-redux but I need something that lets me subscribe to changes to stored data when they are set from other parts of the extension.
Would this be something that can be added, theoretically?
The text was updated successfully, but these errors were encountered:
chrome.storage.onChanged.addListener(async(changes,area)=>{if(!changes.options||area!=='sync'){return;}console.log('the options were updated',awaitoptionsSync.getAll())});
At a minimum I can export a method that lets you manually parse the zipped changes.options.oldValue string so you can access it and diff it yourself. That would be an easy feature.
Adding a optionsStora.onChange event would be a bit more involved, but I'd accept a PR too, as long as reasonable in size.
fregante
changed the title
Feature request: "Change" event to subscribe to so extension pages can update each other
"Change" event to subscribe to so extension pages can update each other
Sep 2, 2022
chrome.storage.onChanged.addListener((changes,area)=>{if(!changes.options||area!=='sync'){return;}constold=optionsStorage._decode(changes.options.oldValue);constnew=optionsStorage._decode(changes.options.newValue);// Run your own diffing });
I'm interested in migrating over to this from https://github.com/tshaddix/webext-redux but I need something that lets me subscribe to changes to stored data when they are set from other parts of the extension.
Would this be something that can be added, theoretically?
The text was updated successfully, but these errors were encountered: