zustandStore()
Creates a zustand store.
Import
Section titled “Import”import { zustandStore } from "@graphrefly/ts/adapters";Signature
Section titled “Signature”function zustandStore( node: Node<T>, initialState: T = nodeSnapshot(node) as T, opts: WritableStoreOptions<T> = {},): ZustandStoreApi<T>Parameters
Section titled “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
Section titled “Returns”The zustand store result.
Example
Section titled “Example”import { zustandStore } from "@graphrefly/ts/adapters";Source
Section titled “Source”packages/ts/src/adapters/store.ts