11 entries · 15-question quiz

Redux & Redux Toolkit — App-Wide State Management

React ↔ Angular reference. React examples use React 19 + TypeScript. Angular examples use modern Angular (standalone components, signals, inject(), @if/@for) with NgRx.

Test yourself

15 questions

  1. 1
    Three Kinds of State

    State is data that, when changed, updates the UI. It falls into three scopes based on who needs it.

  2. 2
    How Redux Works

    Redux is a predictable state container. All shared state lives in one central store, and it changes only when an action is dispatched to a pure reducer.

  3. 3
    Classic Redux: Store and Reducer

    In core Redux, you write a reducer function by hand and pass it to createStore.

  4. 4
    Providing the Store and Reading State

    <Provider> makes the store available to the component tree, and useSelector subscribes a component to part of the state.

  5. 5
    Dispatching Actions and Payloads

    useDispatch returns the store's dispatch function. Calling it with an action triggers the reducer.

  6. 6
    Redux Toolkit: createSlice

    createSlice defines one piece of state (a slice) with its initial state and reducers, and auto-generates the matching action creators.

  7. 7
    Multiple Slices with configureStore

    configureStore combines several slice reducers into one store, with DevTools and thunk middleware set up automatically.

  8. 8
    Typed Hooks

    Pre-typed versions of useSelector and useDispatch that know the store's RootState and AppDispatch.

  9. 9
    Async Logic with createAsyncThunk

    createAsyncThunk wraps an async function and dispatches pending, fulfilled, and rejected actions automatically.

  10. 10
    When to Use Redux, RTK, or Context

    Context and Redux both share state across components, but suit different scales.

  11. 11
    Summary