What problem does it solve?
Zustand provides a concise approach to manage React state with patterns that scale. This Skill consolidates common Zustand usage, including basic stores, persistence, selectors, async actions, slices, immer, and devtools for practical applications.
Core Features & Use Cases
- Basic Store: create simple stores with state and actions.
- Persist Middleware: save state to localStorage for session continuity.
- Selectors: optimize re-renders by selecting state slices.
- Async Actions: fetch and manage remote data within a store.
- Slices Pattern: compose multiple domain slices into a single store.
- Immer Middleware: allow mutable-style updates with Immer.
- DevTools: integrate Zustand with DevTools for debugging.
- Outside React: read and subscribe to stores outside components.
Quick Start
Use the zustand-5 skill to implement a basic store, demonstrate persistence, selectors, async actions, and devtools in a React app.