svelte-multiselect icon indicating copy to clipboard operation
svelte-multiselect copied to clipboard

Add option to persist state across page reloads

Open janosh opened this issue 2 years ago • 0 comments

Currently MultiSelect returns to its initial state on page reloads. It's not too difficult to manually write the current state to a store which is synced to localStorage. But perhaps this is a common enough use case that it should get its own prop:

persist: 'localStorage' | 'sessionStorage' | false = false

sessionStorage persists until the window/tab is closed while localStorage persists until user or app manually clears the cache.

janosh avatar Apr 17 '22 17:04 janosh