Skip to content

Function: defineStorageState() ​

ts
function defineStorageState<P, M>(options): StorageState<InferInputValue<P, M>, InferInputWritable<P, M>>;

Defined in: storage/define-storage-state.ts:82

Defines a value in a storage without a ref, for code that runs outside a component. useStorage turns it into a ref.

Type Parameters ​

Type ParameterDefault type
P extends ParserInput | undefinedundefined
Mnull

Parameters ​

ParameterType
optionsWithParser<StorageStateOptions, P, M>

Returns ​

StorageState<InferInputValue<P, M>, InferInputWritable<P, M>>

Released under the MIT License.