Skip to content

Interface: StorageState<T, W> ​

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

A value in a storage without a ref, for code that runs outside a component.

Type Parameters ​

Type ParameterDefault type
Tstring | Missing
WT | Missing | undefined

Properties ​

PropertyModifierTypeDescriptionDefined in
getpublic() => TReads the value through the parser.storage/define-storage-state.ts:61
keyreadonlystringThe key, without the prefix.storage/define-storage-state.ts:57
removepublic() => voidRemoves the entry, whatever the parser and clearOnDefault say.storage/define-storage-state.ts:65
setpublic(value) => voidWrites the value. null, undefined and the missing value remove the entry.storage/define-storage-state.ts:63
storagereadonlyStorageInstanceThe instance the state reads from.storage/define-storage-state.ts:59
subscribepublic(listener) => UnsubscribeCalls the listener on every change of the entry, and returns the function that stops it.storage/define-storage-state.ts:67

Released under the MIT License.