Is there a way to automatically unsubscribe from an observable upon receiving a specific value?
For example:
let tempSub: Subscription = this.observable$.subscribe(value => {
if (value === 'somethingSpecific') {
tempSub.unsubscribe();
// This approach doesn't work as expected
// due to the fact that tempSub becomes undefined here
}
});