Might you consider an option to ~disable this behaviour~ selectively control this behaviour?
I'm thinking perhaps the persisted could additionally return an updateOtherTabs(enabled: boolean), which would allow you to turn this behaviour on and off.
This flag would determine whether or not the set on line 59 is called.
Alternatively, we could have the option to pass in our own handleStorage function?
Hi,
I see this code, which propagates state changes across instances of the same app in different browsers and tabs:
https://github.com/joshnuss/svelte-persisted-store/blob/dde5eceb183d72e010fb39f83469b0265b5e2c8e/index.ts#L56-L65
Might you consider an option to ~disable this behaviour~ selectively control this behaviour?
I'm thinking perhaps the
persisted
could additionally return anupdateOtherTabs(enabled: boolean)
, which would allow you to turn this behaviour on and off.This flag would determine whether or not the
set
on line 59 is called.Alternatively, we could have the option to pass in our own
handleStorage
function?