In Angular, ReplaySubject returns the last value received, if receiver is late to subscribing.
The ReplaySubject is comparable to the BehaviorSubject in the way that it can send “old” values to new subscribers.
Is there anyways, someone can clear out the cache, and reset, so ReplaySubject has no history at all?
Here is my ReplayService method
Would like to add to the following method, to have a clearhistory method, etc
export class BasicReplayService {
private messageSource = new ReplaySubject();
currentMessage = this.messageSource.asObservable();
constructor() { }
changeMessage(currentMessage) {
this.messageSource.next(currentMessage);
}
}