useState
Callable
Parameters
optionalname: string
The name of the store to use.
defaultValue: State = ...
If the store does not yet have a value in it, the value will be initialized with the
defaultValue
you provide.optionaloptions: UseStateOptions
An optional object parameter where a custom
keyValueStoreName
andconfig
can be passed in.
Returns Promise<State>
Easily create and manage state values. All state values are automatically persisted.
Values can be modified by simply using the assignment operator.