In a real-time data streaming application built with Angular, you want to ensure that multiple components receive the same data from an observable without creating multiple subscriptions. What kind of observable would you use?

  • AsyncSubject
  • BehaviorSubject
  • ReplaySubject
  • Subject
To ensure multiple components receive the same data from an observable without multiple subscriptions, you would use a ReplaySubject. It replays the latest emitted value to all new subscribers.
Add your answer
Loading...

Leave a comment

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