Creates a simple state observable that also returns a function to update the value. The state is persisted to the provided storage. Since this is stored in localStorage or sessionStorage it should not be used for large data.
The key to use for storage.
Optional
The initial value of the state.
The storage to use for persistence.
Creates a simple state observable that also returns a function to update the value. The state is persisted to the provided storage. Since this is stored in localStorage or sessionStorage it should not be used for large data.