region-zustand
v12.0.0-alpha.0
Published
region-zustand - React state management powered by zustand
Maintainers
Readme
region-zustand
Region state management powered by zustand.
This package provides the same API as region-react but uses zustand as the underlying state management solution.
Installation
npm install region-zustand
# or
pnpm add region-zustand
# or
yarn add region-zustandUsage
The API is identical to region-react. See the main documentation for details.
import { createRegion } from 'region-zustand';
const userRegion = createRegion({ name: 'Alice' });
function App() {
const user = userRegion.useValue();
return <div>{user.name}</div>;
}Features
- ✅ Same API as region-react
- ✅ Powered by zustand for better performance
- ✅ Built-in Redux DevTools support via zustand
- ✅ localStorage persistence using zustand's persist middleware
- ✅ All async strategies: acceptLatest, acceptFirst, acceptSequenced, acceptEvery
- ✅ Type-safe with full TypeScript support
License
MIT
