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
- 1Three Kinds of State
State is data that, when changed, updates the UI. It falls into three scopes based on who needs it.
- 2How 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.
- 3Classic Redux: Store and Reducer
In core Redux, you write a reducer function by hand and pass it to
createStore. - 4Providing the Store and Reading State
<Provider>makes the store available to the component tree, anduseSelectorsubscribes a component to part of the state. - 5Dispatching Actions and Payloads
useDispatchreturns the store'sdispatchfunction. Calling it with an action triggers the reducer. - 6Redux Toolkit:
createSlicecreateSlicedefines one piece of state (a slice) with its initial state and reducers, and auto-generates the matching action creators. - 7Multiple Slices with
configureStoreconfigureStorecombines several slice reducers into one store, with DevTools and thunk middleware set up automatically. - 8Typed Hooks
Pre-typed versions of
useSelectoranduseDispatchthat know the store'sRootStateandAppDispatch. - 9Async Logic with
createAsyncThunkcreateAsyncThunkwraps an async function and dispatchespending,fulfilled, andrejectedactions automatically. - 10When to Use Redux, RTK, or Context
Context and Redux both share state across components, but suit different scales.
- 11Summary