From aj-geddes-useful-ai-prompts-4
Manages application state using Redux, MobX, Zustand, and Context API. Use for centralizing state in complex apps with multiple components.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:frontend-state-managementThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Implement scalable state management solutions using modern patterns and libraries to handle application state, side effects, and data flow across components.
Minimal working example:
// store/userSlice.ts
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
interface User {
id: number;
name: string;
email: string;
}
interface UserState {
items: User[];
loading: boolean;
error: string | null;
}
const initialState: UserState = {
items: [],
loading: false,
error: null
};
export const fetchUsers = createAsyncThunk(
'users/fetchUsers',
async (_, { rejectWithValue }) => {
try {
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Redux with Redux Toolkit (React) | Redux with Redux Toolkit (React) |
| Zustand (Lightweight State Management) | Zustand (Lightweight State Management) |
| Context API + useReducer | Context API + useReducer |
| MobX (Observable State) | MobX (Observable State) |
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4Guides on frontend state management: Redux, Zustand, MobX, Jotai, Recoil, React Context. Helps choose the right solution, implement store architecture, and fix issues like prop drilling or stale state.
Guides modern React state management with Redux Toolkit, Zustand, Jotai, and React Query. Use for global state setup, server state, or choosing solutions.
Guides on modern React state management with Redux Toolkit, Zustand, Jotai, and React Query. Use for global state, server state, or choosing a solution.