What problem does it solve?
Managing increasingly complex client-side state with predictable, lightweight patterns in React applications, avoiding unnecessary re-renders and scattered state logic across components.
Core Features & Use Cases
- Basic store patterns: simple create-based stores for counters and primitive state.
- Persistence: persist middleware for localStorage-backed settings and user preferences.
- Selectors & performance: selecting specific fields and using shallow comparison to minimize re-renders.
- Async actions: encapsulated async fetch flows with loading and error handling.
- Slices, Immer, and DevTools: modular slice composition, immutable updates via Immer, and Redux DevTools integration for debugging.
- Outside-React usage: access and subscribe to store state from non-component code for background tasks.
Quick Start
Use the zustand-5 skill to create a persistable counter store and demonstrate increment, decrement, and reset actions.