Interface: MnemonicKeyDescriptor<T, K>
Defined in: src/Mnemonic/types.ts:1130
Reusable, importable contract for a single persisted key.
Descriptors package the key name and its useMnemonicKey(...) options into
a stable object that can be defined once at module scope and reused across
components. This helps keep persistence behavior explicit and consistent,
especially when the same key appears in multiple parts of an application.
Example
const themeKey = defineMnemonicKey("theme", {
defaultValue: "light" as "light" | "dark",
listenCrossTab: true,
});
const { value, set } = useMnemonicKey(themeKey);
See
- defineMnemonicKey - Helper for creating descriptors
- useMnemonicKey - Hook that consumes descriptors
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
T | - | The decoded value type for the key |
K extends string | string | The literal key name |
Properties
key
readonlykey:K
Defined in: src/Mnemonic/types.ts:1134
Unprefixed storage key name.
options
readonlyoptions:UseMnemonicKeyOptions<T>
Defined in: src/Mnemonic/types.ts:1139
Canonical options for this key.