29
Necessary Unsubscribe Observables Created Http Methods
general · 1 signals · 1 source
Evidence
Is it necessary to unsubscribe from observables created by Http methods to avoid memory leaks? — Do you need to unsubscribe from Angular 2 http calls to prevent memory leak? fetchFilm(index) { var sub = this._http.get(`http://example.com`) .map(result => result.json()) .map(json => { dispatch(this.receiveFilm(json)); }) .subscribe(e=>sub.unsubscribe()); ...