Can someone shed some light on how I immediately unsubscribe from the observed rxjs subscription? Observed from Angular 2 EventEmitter. When I receive the event, I want to unsubscribe. The problem here is unsubscribing inside the function block. I feel like this is the wrong approach:
this.subscription = observable.subscribe((result: any) => { // do something // **unsubscribe** });
thanks
source share