I'm currently looking for an effective way to indicate when a ReplaySubject is empty.
import {ReplaySubject} from 'rxjs/ReplaySubject';
const rs = new ReplaySubject<Object>();
// ...
constructor(){
this.sub = rs.subscribe(...);
}
Each time the constructor is called, all items from the subject are replayed. But my main question is - is there any event we can monitor to know when the subject is empty?
The only solution I can come up with is triggering a custom event when the subject is done, like so:
rs.next({done:true});
Is sending data to the next() method the most effective way to signal that the ReplaySubject is temporarily empty or out of events?