是否有必要從http方法創(chuàng)建的可觀測數(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());
...
是否有必要從http方法創(chuàng)建的可觀測數(shù)據(jù)中取消訂閱?
30秒到達戰(zhàn)場
2019-07-15 16:24:28