State Management & Change Detection Flashcards
6 cards from real Angular Web Framework practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 State Management & Change Detection flashcards as text
In the Flux/Redux pattern used by NgRx, what is the single source of truth for application state?
Answer: Store
The Store is an immutable, single source of truth that holds the entire application state tree.
Which Angular signal API creates a writable reactive value introduced in Angular 16+?
Answer: signal()
signal() creates a writable reactive primitive that Angular tracks for fine-grained change detection.
What is the purpose of the computed() function in Angular Signals?
Answer: Derive a read-only value from one or more signals
computed() creates a lazily evaluated, memoized read-only signal derived from other signals.
Which function converts an RxJS Observable into an Angular Signal?
Answer: toSignal()
toSignal() from @angular/core/rxjs-interop subscribes to an Observable and exposes its latest value as a Signal.
In Angular's default change detection, what triggers the detection cycle?
Answer: Async events like DOM events, timers, and HTTP responses via Zone.js
Zone.js patches async APIs so Angular is notified whenever any async event completes, triggering a top-down change detection pass.
What NgRx operator is used inside createEffect() to handle errors without killing the effect stream?
Answer: catchError with EMPTY or of()
Using catchError inside the inner Observable (not the outer stream) and returning EMPTY or a fallback action keeps the effect alive after an error.