What problem does it solve?
Provides clear patterns and conventions for organizing and maintaining Zustand stores to reduce bugs, inconsistent action naming, and brittle state updates in React projects.
Core Features & Use Cases
- Action hierarchy & naming: Defines public, internal, and dispatch action naming and responsibilities to keep UI and business logic separated.
- Reducer vs set guidance: Explains when to use reducer patterns for complex lists/maps and when to use simple set operations for primitive updates.
- Optimistic update patterns: Documents safe optimistic update flows, when to avoid optimism (destructive deletes), and refresh strategies.
- Class-based slice composition: Shows how to migrate to class-based action implementations, use private fields, and compose slices with flattenActions for large stores.
- Slice organization & selectors: Recommends file layout, state shapes, selectors, and SWR integration patterns for caching and refresh.
Quick Start
Review the src/store directory and recommend slice organization, reducer versus set choices, action naming, and optimistic update patterns for messages and topics.