What is the difference between a BehaviorSubject and a ReplaySubject?
- A BehaviorSubject emits all previous values
- A BehaviorSubject emits the last value
- A ReplaySubject emits all previous values
- A ReplaySubject emits the last value
The key difference is that a BehaviorSubject emits only the last value upon subscription, while a ReplaySubject emits all previous values to new subscribers.
Loading...
Related Quiz
- To use a custom pipe in a template, you have to add it to the _____ array in the module.
- In Angular, the _____ Guard checks whether a route can be deactivated.
- How can you identify and select a specific element on a webpage in a Protractor test?
- Which RxJS operator can be used to combine multiple Observables into a single Observable?
- You want to track the time taken for a user to navigate from one page to another in your Angular application. Which Router Events can be useful for this purpose?