Background:
I am trying to write a message service with Rxjs and angular 6. I use a ReplaySubject to keep the sent messages, then subscriber even after message emited can get them. So the message can be cross different angular components.
I successfully implemented these, however, I meet a problem that for every new subscriber will get the all of messages in the ReplaySubject, I want to delete some particular messages in ReplaySubject. or even clear all the ReplaySubject.
Question:
How can I delete some item inside a ReplaySubject?
If impossible, is there any work around?
If impossible nether, is there any way to create a new ReplaySubject, then copy the subscriber to the new ReplaySubject? so all subscriber can still receive messages.
Many thanks.