OptionaluseSessionStorage: booleanWatch a storage value changes, this needs to be executed only in browser
context (it uses window.addEventListener("storage")).
Inspiration from Multi Tab Logout in React — Redux
Clear all storage values (it uses localStorage.remove()).
Get all storage value (it uses localStorage.get()).
Unparseable values with JSON.parse() return their value as it is.
On ssr or if the given key argument is not found defaultValue is
returned, otherwise null.
OptionaldefaultValue: T[TKey] | nullCheck if a storage value is truthy (it uses localStorage.get()).
Remove a storage value (it uses localStorage.remove()).
Set a storage value (it uses localStorage.set()).
Non-string values are stringified with JSON.stringify()
Optionalvalue: T[TKey]Set all given storage values (it uses localStorage.set()).
Non-string values are stringified with JSON.stringify(), undefined
and null values are removed from the storage
Utility to create a storage instance to interact with
localStorageusing encrypted (encoded) key/values.