Skip to main content

Interface: StoreHooks<S>

A store bound to a name and a shape: typed hooks with no per-call generics.

Type Parameters

Type Parameter
S extends Record<string, unknown>

Properties

get

get: () => AnyStore;

The underlying store instance (the same one the hooks use) — for non-React code.

Returns

AnyStore


useSharedState

useSharedState: <K>(key, initial) => [S[K], (next) => void];

Type Parameters

Type Parameter
K extends string

Parameters

ParameterType
keyK
initialS[K]

Returns

[S[K], (next) => void]