I used this template:
func myObservable() Observable<boolean> { ... } func myFunc() { myObservable().subscribe((cond: boolean) => { if (cond) {
However, I see no way to unsubscribe, which could lead to a memory leak.
The reason I'm asking is because the Angular 2 HTTP client uses the same template - although I believe that it automatically cancels the subscription and I would like to do the same.
javascript angularjs angular typescript rxjs5
Dan
source share