thencc / any-wallet

web3 auth for any algo wallets
https://thencc.github.io/any-wallet/
3 stars 1 forks source link

add DOM storage evt listener to sync state across windows/tabs ? #30

Closed spencercap closed 1 year ago

spencercap commented 1 year ago

browsers DO have a storage event but its only observed from the tab/window NOT being modified, or, if the record is removed completely on the current page.

re: https://gist.github.com/du5rte/dbd18a1a6dc72d866737a5e95ca1e663?permalink_comment_id=3954713#gistcomment-3954713


rn we are syncing state w mobx-persist to localstorage AND using window.top.postMess to get dux components sync'd up while on the same page.

spencercap commented 1 year ago

this is happening. state syncs between different tabs/window + instances on the same page thanks to the hefty work done in state/index.ts