GraphReFlyTS

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

ParameterTypeDescription
nodeNode<T>node value used by the helper.
initialStateTinitial state value used by the helper.
optsWritableStoreOptions<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