zustand-store

Create Zustand stores with slices, strict selectors, and shallow equality.

1|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/lyzno1/flux --skill zustand-store-lyzno1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: zustand-store
Source: https://github.com/lyzno1/flux/tree/main/.agents/skills/zustand-store
Command: npx skills add https://github.com/lyzno1/flux --skill zustand-store-lyzno1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Zustand patterns help teams scale client-side state across a Flux monorepo using a simple, typed store model with slices and strict selectors.

Core Features & Use Cases

  • Slice-based stores and factory patterns to compose domain stores
  • Strict selectors with shallow equality to ensure robust, predictable UI updates
  • React integration strategies and per-domain store organization for scalable frontends
  • Use cases include creating new stores, adding slices, writing selectors, integrating stores with components, or refactoring client-side state architecture.

Quick Start

Add a domain store using the createStore wrapper, define slices, and export selectors for components to consume.

Frequently Asked Questions about zustand-store

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure Zustand state management with slices in a React monorepo?

Zustand state management with slices uses a factory pattern to compose domain stores, ensuring modular state organization. You define typed store slices and use a createStore wrapper to combine them for predictable state across monorepo packages.

How do I write Zustand selectors with shallow equality for React components?

Zustand selectors use shallow equality to prevent unnecessary UI re-renders by comparing output references. You write strict selector functions extracting specific state fields, ensuring components update only when subscribed data changes.

Does Zustand work with TypeScript for strict store definitions?

Zustand works with TypeScript to enforce strict store definitions and typed state slices. This integration provides compile-time safety for state shapes, selector return types, and component props across your React application.

What is the best way to organize per-domain Zustand stores in a large React app?

Per-domain Zustand stores organize state by creating separate stores for distinct application areas rather than one global store. This approach uses app-local stores and slice architecture to maintain scalable frontends.

Why use subscribeWithSelector middleware when creating a Zustand store?

subscribeWithSelector middleware enables fine-grained subscriptions to specific state changes within a Zustand store. Combined with a createStore wrapper, it enforces predictable state management and modular updates across React components.