This PR uses the storage event so that when the localStorage is modified outside of the application it is synchronized back to recoil.
This allows for synchronization of state between multiple tabs/windows/iframe, and updates the application's recoil state when a developer edits the localState within "Application" tab of chrome DevTools.
With the addStorageListener property of PersistConfiguration, the functionality can be adapted to storage configurations other than the localStorage, or if this is undesired, it can be disabled.
This PR uses the storage event so that when the localStorage is modified outside of the application it is synchronized back to recoil.
This allows for synchronization of state between multiple tabs/windows/iframe, and updates the application's recoil state when a developer edits the localState within "Application" tab of chrome DevTools.
With the
addStorageListener
property ofPersistConfiguration
, the functionality can be adapted to storage configurations other than thelocalStorage
, or if this is undesired, it can be disabled.