SuperAPI AI Directory

redux

General & other

View repository

Updated 10-15 21:48

About this skill

When to use this skill

Use this skill whenever the user wants to:

  • Manage global state in React applications with Redux (store, reducer, action, dispatch)
  • Use Redux Toolkit (createSlice, configureStore) or the classic approach

How to use this skill

  1. Core:store、reducer、action、dispatch; useSelector、useDispatch。
  2. Toolkit: createSlice, configureStore, createAsyncThunk; DevTools and middleware.
  3. Reference:https://react-redux.js.org/ 、https://redux-toolkit.js.org/

Best Practices

  • Keep state flat, split reducers by domain; actions and reducers are pure functions.
  • Use thunk or RTK Query for async; avoid making requests in reducers.

Keywords

redux, Redux Toolkit, store, state management, React