API Reference
@json-render/zustand
Zustand adapter for json-render's StateStore interface.
Requires Zustand v5+. Zustand v4 is not supported due to breaking API changes in the vanilla store interface.
Installation
zustandStateStore
Create a StateStore backed by a Zustand vanilla store.
Options
| Option | Type | Required | Description |
|---|---|---|---|
store | StoreApi<S> | Yes | A Zustand vanilla store (from createStore in zustand/vanilla). |
selector | (state: S) => StateModel | No | Select the json-render slice from the store state. Defaults to the entire state. |
updater | (nextState: StateModel, store: StoreApi<S>) => void | No | Apply a state change back to the store. Defaults to a shallow merge. |
Example
Nested Slice
Re-exports
| Export | Source |
|---|---|
StateStore | @json-render/core |