Redux & Redux Toolkit — App-Wide State ManagementEntry 2 of 11

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.

Notes

The flow is one-way:

  1. A component dispatches an action: a plain object describing what happened ({ type: 'increment' }).
  2. Redux forwards the action to the reducer.
  3. The reducer takes the old state and the action, and returns a new state.
  4. The store saves the new state.
  5. Components subscribed to that part of the state re-render.

Building blocks:

  • Store: Holds the entire state tree. One per app.
  • Action: Plain object with a type and optional payload.
  • Reducer: Pure function (state, action) => newState. No side effects, no async, no mutation.
  • Dispatch: Sends an action to the store.
  • Selector: Function that reads a piece of state.

Components never change the store directly.

What / Why / When

What

A centralized, event-driven state model.

Why

Every change goes through one predictable path, so state transitions are traceable and debuggable (Redux DevTools supports time-travel).

When

Many components read and update the same data.

Quick reference

ConceptReduxNgRx
Central containerStoreStore
EventActionAction
State transitionReducerReducer
Send eventdispatch()store.dispatch()
Read stateSelectorSelector
Side effectsThunksEffects