con un clic
zustand
Modern, lightweight state management for React
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Modern, lightweight state management for React
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Comprehensive skill framework from obra/superpowers for AI-assisted development workflows, covering planning, implementation, debugging, code review, and more
独立开发者 Web/SaaS 项目专属 Vibe Coding 全流程。Invoke when starting a new web product project to run a complete 14-skill pipeline from idea to launch, with controlled feedback loops.
NestJS best practices and architecture patterns for building production-ready applications. This skill should be used when writing, reviewing, or refactoring NestJS code to ensure proper patterns for modules, dependency injection, security, and performance.
Personal coding conventions and best practices
MUST be used for React tasks. Strongly recommends functional components with Hooks and TypeScript as standard approach. Covers React 19, Next.js, SSR. Load for any React, .tsx files, React Router, Redux, or Vite with React work.
基于 Vue 3 的企业级 UI 组件库,提供 68+ 高质量组件。IMPORTANT: 这是 Ant Design Vue,不是 React 版本。使用 a- 前缀组件(如 a-button, a-table)。
| name | zustand |
| title | Zustand State Management |
| description | Modern, lightweight state management for React |
| icon | 🗄️ |
| tags | ["react","state-management","zustand"] |
Zustand is a small, fast and scalable state-management solution using simplified flux principles. It has a comfy API based on hooks, isn't boilerplatey or opinionated.
npm install zustand
# or
yarn add zustand
# or
pnpm add zustand
import { create } from 'zustand'
interface CounterState {
count: number
increment: () => void
decrement: () => void
}
const useCounterStore = create<CounterState>((set) => ({
count: 0,
increment: () => set((state) => ({ count: state.count + 1 })),
decrement: () => set((state) => ({ count: state.count - 1 })),
}))
function Counter() {
const { count, increment, decrement } = useCounterStore()
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>+</button>
<button onClick={decrement}>-</button>
</div>
)
}
function Count() {
const count = useCounterStore((state) => state.count)
return <div>{count}</div>
}
function Controls() {
const { increment, decrement } = useCounterStore()
return (
<>
<button onClick={increment}>+</button>
<button onClick={decrement}>-</button>
</>
)
}
const useUserStore = create<UserState>((set) => ({
user: null,
isLoading: false,
error: null,
fetchUser: async (id: string) => {
set({ isLoading: true, error: null })
try {
const response = await api.getUser(id)
set({ user: response.data, isLoading: false })
} catch (error) {
set({ error: error as Error, isLoading: false })
}
},
}))
import { persist, devtools } from 'zustand/middleware'
const useStore = create(
devtools(
persist(
(set) => ({
// store implementation
}),
{ name: 'app-storage' }
)
)
)