是否有必要從http方法創(chuàng)建的可觀測(cè)數(shù)據(jù)中取消訂閱?您需要取消訂閱角2 http調(diào)用以防止內(nèi)存泄漏嗎? fetchFilm(index) {
var sub = this._http.get(`http://example.com`)
.map(result => result.json())
.map(json => {
dispatch(this.receiveFilm(json));
})
.subscribe(e=>sub.unsubscribe());
...
請(qǐng)問是否有必要從http方法創(chuàng)建的可觀測(cè)數(shù)據(jù)中取消訂閱?
明月笑刀無(wú)情
2019-10-22 17:12:36