Interface: StorageStateOptions
Defined in: storage/define-storage-state.ts:24
The options of defineStorageState and useStorage. The defaults of storage and mode, and the prefix in front of key, come from the storage options of the instance.
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
clearOnDefault? | boolean | true | Removes the entry instead of writing a value equal to the parser default. | storage/define-storage-state.ts:39 |
key | string | undefined | The entry to read and write, without the prefix. | storage/define-storage-state.ts:26 |
missing? | unknown | the missing of the instance | What the state reads without a value or a default, and what removes the entry when written. A key set to undefined means undefined, and a key left out takes the one of the instance. | storage/define-storage-state.ts:37 |
mode? | StateMode | 'optimistic' | With 'optimistic', the state reads back what was written even when the browser refused to store it, until the entry changes to something else. With 'source', every read goes to the storage. | storage/define-storage-state.ts:47 |
parser? | ParserInput | parseAsString | Turns the stored string into a value and determines the type of the ref. | storage/define-storage-state.ts:30 |
storage? | StorageSource | the default storage of the instance, 'local' unless configured | Where the value lives. | storage/define-storage-state.ts:28 |