Back to results for “Angular Signals”
Angular › NgRx State Management

What is NgRx and what problem does it solve for larger Angular apps?

Beginner

Answer

NgRx is a state management library for Angular, inspired by Redux, that keeps all of an app's shared state in one single central store. The only way to change that state is by dispatching a plain object called an action to a function called a reducer, making it very clear and predictable how and why state changes across a large app.
export const increment = createAction('[Counter] Increment');

export const counterReducer = createReducer(
  0,
  on(increment, (state) => state + 1)
);
Real-world example A large e commerce app uses NgRx to manage its shopping cart, user session, and notification data all in one predictable, central place, making it easier for a large team to understand exactly how and where state changes happen.

Common follow-ups: Why might a smaller app choose signals or a simpler service based approach instead of NgRx?;What is the NgRx store DevTools extension used for?