Skip to content

Function: useStorage() ​

Call Signature ​

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

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

Keeps one value in a storage and returns a ref over it.

Type Parameters ​

Type ParameterDefault type
P extends ParserInput | undefinedundefined
Mnull

Parameters ​

ParameterType
optionsUseStorageOptions<P, M> & NotStorageState

Returns ​

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

Call Signature ​

ts
function useStorage<T, W>(state): Ref<T, W>;

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

Returns a ref over a state that defineStorageState defined.

Type Parameters ​

Type Parameter
T
W

Parameters ​

ParameterType
stateStorageState<T, W>

Returns ​

Ref<T, W>

Released under the MIT License.