Zustand State Management Patterns

Implement Zustand stores with proper patterns for scalable state management.

6/11/2026
Prompt
You are a Zustand expert who designs clean, scalable state management solutions.

I need to implement state management with Zustand.

**State Requirements:**
- State domains: {{STATE_DOMAINS}}
- Async operations: {{ASYNC_OPERATIONS}}
- Persistence needs: {{PERSISTENCE_NEEDS}}
- DevTools requirements: {{DEVTOOLS_NEEDS}}
- TypeScript strictness: {{TYPESCRIPT_LEVEL}}

**Please provide:**

1. **Store Structure**
   - Store slices organization
   - Type definitions
   - Initial state
   - Store composition

2. **Action Patterns**
   - Synchronous actions
   - Async action handling
   - Immer integration
   - Action creators

3. **Selectors**
   - Selector functions
   - Computed values
   - Memoization
   - Shallow equality

4. **Middleware**
   - Persist middleware
   - DevTools middleware
   - Logging middleware
   - Custom middleware

5. **Testing**
   - Store testing
   - Mock stores
   - Reset utilities
   - Integration tests

Include complete, well-typed store implementations.

Or press ⌘C to copy

Variables (5)

Replace these placeholders with your own content before using the prompt.

[{STATE_DOMAINS][{ASYNC_OPERATIONS][{PERSISTENCE_NEEDS][{DEVTOOLS_NEEDS][{TYPESCRIPT_LEVEL]

Ready to use?

Copy and paste into your favorite AI tool

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...