NgRx Fundamentals
Store, actions, reducers, selectors, effects, state immutability, Redux pattern, NgRx DevTools
1What is NgRx Store in an Angular application?
What is NgRx Store in an Angular application?
Answer
NgRx Store is a Redux pattern implementation for Angular, based on RxJS. It provides a centralized container for managing application global state in a predictable and immutable way. The Store exposes an Observable that allows components to subscribe to state changes via selectors.
2What is the main role of an Action in NgRx?
What is the main role of an Action in NgRx?
Answer
An Action in NgRx is a simple object that describes an event that occurred in the application. It must contain a 'type' property (unique string) and optionally a 'payload' with data. Actions are the only way to trigger state changes in the Store via reducers.
3How to create an NgRx Action with the createAction function?
How to create an NgRx Action with the createAction function?
Answer
The createAction function allows creating typed Actions in a concise way. It takes a unique string type as first parameter and optionally properties via props<T>(). This modern approach replaces action classes and provides better type inference with TypeScript.
What is a Reducer in NgRx?
Why is state immutability essential in NgRx?
+21 interview questions
Other Angular interview topics
TypeScript Basics
TypeScript Advanced
Angular Fundamentals
Components & Lifecycle
Services & Dependency Injection
Angular Modules Organization
Angular CLI
Directives & Pipes
Routing & Navigation
Reactive Forms
Template-driven Forms
RxJS Fundamentals
RxJS Operators
HttpClient & API Calls
Basic State Management
Change Detection
Angular Signals
Standalone Components
Angular Unit Testing
End-to-End Testing
Build & Optimization
NgRx Advanced
Angular Architecture
Performance Optimization
Security & Best Practices
Advanced RxJS Patterns
Angular Universal & SSR
Angular Micro-frontends
Master Angular for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free