API Reference
zustandStore()
Creates a zustand store.
Import
import { zustandStore } from "@graphrefly/ts/adapters";
Signature
function zustandStore(
node: Node<T>,
initialState: T = nodeSnapshot(node) as T,
opts: WritableStoreOptions<T> = {},
): ZustandStoreApi<T>
Parameters
| Parameter | Type | Description |
|---|---|---|
node | Node<T> | node value used by the helper. |
initialState | T | initial state value used by the helper. |
opts | WritableStoreOptions<T> | Options that configure the helper. |
Returns
The zustand store result.
Example
import { zustandStore } from "@graphrefly/ts/adapters";
Source
packages/ts/src/adapters/store.ts