I am trying to read all emitted values of a replaySubject.
selectedPersons = new ReplaySubject();
sub = new Subscription;
--
ngOnInit() {
this.subscription = this.selectedPersons.subscribe((resp) => {
console.log(this.selectedPersons)
console.log(this.selectedPersons._events) <--- This one doesnt work because its private but i need this values
})
}
--
onSelect(value: Person) {
this.selectedPersons.next(value)
}
Data will be emitted in this Subject and i want to read all its values, not only the last one. What is the best approach to do ?
I want to display this data then in the html with | async
I assume every time new event comes you want to get all the events that arrived before. to achieve it you can use
scan