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
Nice library! Especially the combination of using zod to parse data, and automatically initialising the store. (I've previously manually initialised the store on each page with this implementation which works but is a worse DX).
One feature that could be a nice addition to this library is to listen for the storage event on the window, and always use the latest value no matter which tab has been used. This event tells us which localStorage key that was changed, making it possible to only update when the relevant key has changed in another tab.
To keep the core library clean, this feature should likely be opt-in when creating the store.
The text was updated successfully, but these errors were encountered:
Nice library! Especially the combination of using zod to parse data, and automatically initialising the store. (I've previously manually initialised the store on each page with this implementation which works but is a worse DX).
One feature that could be a nice addition to this library is to listen for the
storage
event on the window, and always use the latest value no matter which tab has been used. This event tells us whichlocalStorage
key that was changed, making it possible to only update when the relevant key has changed in another tab.To keep the core library clean, this feature should likely be opt-in when creating the store.
The text was updated successfully, but these errors were encountered: