Skip to content

Function: useSessionStorage() ​

ts
function useSessionStorage<P, M>(options): Ref<InferInputValue<P, UnwrapOption<M>>, InferInputWritable<P, UnwrapOption<M>>>;

Defined in: storage/use-storage.ts:148

Keeps one value in session storage, which belongs to one tab, and returns a ref over it.

Type Parameters ​

Type ParameterDefault type
P extends ParserInput | undefinedundefined
Mnull

Parameters ​

ParameterType
optionsUseSessionStorageOptions<P, M>

Returns ​

Ref<InferInputValue<P, UnwrapOption<M>>, InferInputWritable<P, UnwrapOption<M>>>

Released under the MIT License.