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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *