Skip to content
PACKAGES

zustandStore()

Creates a zustand store.

import { zustandStore } from "@graphrefly/ts/adapters";
function zustandStore(
node: Node<T>,
initialState: T = nodeSnapshot(node) as T,
opts: WritableStoreOptions<T> = {},
): ZustandStoreApi<T>
ParameterTypeDescription
nodeNode<T>node value used by the helper.
initialStateTinitial state value used by the helper.
optsWritableStoreOptions<T>Options that configure the helper.

The zustand store result.

import { zustandStore } from "@graphrefly/ts/adapters";

packages/ts/src/adapters/store.ts