Closed wiber closed 8 years ago
If I understand redux (and do correct me if I'm wrong) persisting the actions to localstorage and applying them both from there and from the ui is the way to go? Or catching them up when window becomes active.
Yes, you are right, you have to persist redux states. Use redux-persist
for that. To get it work with chrome.storage
instead of window.localStorage
, use chrome-storage-local
. An example of configuration can be found here, which is used for returning the store asynchronously.
Thanks @zalmoxisus , that looks good.
Hi,
Updating the popup doesn't persist to localstore or propagate to other windows where the extension is running. How would I rerender all reacts when localstore changes?
I'm looking to persist state to localstorage in a way similar to these:
https://github.com/STRML/react-localstorage http://stackoverflow.com/questions/21741754/react-js-syncing-entire-state-to-localstorage
I can then fire chrome.storage.onChanged.addListener but where does that go to reload the DOM(s) ?
Cheers,
Elias