0
I have a behaviorSubject
that emits values and an Observable I use to receive the values issued:
observableSource = new BehaviorSubject(null);
observable$: Observable<string> = this.observableSource.asObservable();
At the start of my component he signs up for this Observable
through a Subscription
:
ngOnInit() {
this.mySubscription = this.myService.observable$.subscribe((res) => {
console.log(res)
})
}
ngOnDestroy() {
this.mySubscription.unsubscribe();
}
Currently when my component is destroyed and started again, it receives a new inscription from my Observable
, it has as initial value the last value issued.
Is there any way to sign me up for a Observable
, it does not issue the last value but the initial value null
?