Adapter
Zustand Adapter
Using Unistash with Zustand
Zustand Adapter
The Zustand adapter provides Unistash functionality using Zustand under the hood.
Installation
npm install @unistash/zustand zustandFeatures
- No provider needed
- Works outside React components
- Excellent performance
- Small bundle size
Usage
import { createStore } from "@unistash/zustand";
const useStore = createStore({
state: { count: 0 },
actions: {
increment: (state) => ({ count: state.count + 1 }),
},
});No provider wrapper needed! Just use the hook directly.