RxJS & Observables Flashcards
7 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 7 RxJS & Observables flashcards as text
What does `forkJoin` emit when all source Observables complete?
Answer: An array of the last values from each source Observable
forkJoin waits for all source Observables to complete, then emits a single array containing each source's final emitted value.
Which RxJS operator delays each emission by a specified time but does not drop values?
Answer: delay
delay shifts every emission forward in time by the specified duration without discarding any values.
What is the role of `pipe()` in RxJS?
Answer: Chains multiple operators together into a single transformation
pipe() composes multiple RxJS operators in sequence, passing each operator's output as input to the next.
Which operator would you use to handle errors by retrying the source Observable a fixed number of times?
Answer: retry
retry(n) resubscribes to the source Observable up to n times when it errors before propagating the error.
What does `exhaustMap` do that differs from `mergeMap` and `switchMap`?
Answer: It ignores new source values while the current inner Observable is still active
exhaustMap drops incoming source values entirely while an inner Observable is in progress, preventing overlapping requests.
In Angular, which AsyncPipe behavior automatically handles Observable unsubscription?
Answer: It unsubscribes when the component's template is destroyed
The AsyncPipe subscribes to an Observable and automatically unsubscribes when the component's view is torn down, preventing memory leaks.
Which RxJS operator emits a value from the source only after a specified quiet period with no new emissions?
Answer: debounceTime
debounceTime waits for a silence window after the last emission before forwarding the value, commonly used for search-as-you-type inputs.