Interface: MnemonicKeyState<T>
Defined in: src/Mnemonic/types.ts:1078
Return shape from useMnemonicKey.
This mirrors the familiar useState mental model while making the storage
semantics explicit:
set(...)writes a new persisted valuereset()writesdefaultValueback into storageremove()deletes the key entirely so reads fall back todefaultValue
See the Clearable Persisted Values guide for the semantic differences between clearing, resetting, and removing a key.
See
UseMnemonicKeyOptions - Hook configuration and lifecycle details
Type Parameters
| Type Parameter | Description |
|---|---|
T | The decoded value type for the key |
Properties
remove()
remove: () =>
void
Defined in: src/Mnemonic/types.ts:1103
Delete the key from storage entirely.
Future reads will fall back to defaultValue until the key is written
again.
Returns
void
reset()
reset: () =>
void
Defined in: src/Mnemonic/types.ts:1095
Reset the key back to defaultValue and persist that default.
Returns
void
set()
set: (
next) =>void
Defined in: src/Mnemonic/types.ts:1090
Persist a new value.
Accepts either a direct replacement value or an updater function that receives the current decoded value.
Parameters
| Parameter | Type |
|---|---|
next | T | (current) => T |
Returns
void
value
value:
T
Defined in: src/Mnemonic/types.ts:1082
Current decoded value, or the default when the key is absent or invalid.