NgRx fundamentals: Store, actions, reducers, selectors
Learn NgRx fundamentals: Store, actions, reducers, selectors (Module 15 · State Management, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
NgRx fundamentals • NgRx is Angular's implementation of the Redux pattern: one predictable, central Store and a strict one-way loop. Think of a bank: you do not edit the ledger yourself; you fill a slip ( action ), the clerk ( reducer ) updates the ledger by fixed rules, and you read balances through statements ( selectors ). • The loop: component dispatches an Action to the Store ; a Reducer (pure function) returns the next state; Selectors read slices; components re-render. Effects handle side effects such as HTTP. • Install: ng add @ngrx/store (plus @ngrx/effects , @ngrx/entity ,...
More lessons in Module 15 · State Management
- Module 15 overview and checklist
- State fundamentals: local, shared, service, RxJS and Signals state
- Immutable updates, normalization, derived, loading and error state
- Authentication state, persisting state and browser storage
- NgRx effects, entities, feature state and DevTools
- NgRx Signal Store
- State management testing and choosing an approach