PersistedState
Create reactive state that is persisted and synchronized across browser sessions and tabs using Web Storage.
Demo
Count: 0
Note
You can refresh this page and/or open it in another tab to see the count state being persisted
and synchronized across sessions and tabs.
Usage
PersistedState
allows for syncing and persisting state across browser sessions using localStorage
or sessionStorage
. Initialize PersistedState
by providing a unique key and an
initial value for the state.
PersistedState
also includes an options
object.