我很难理解RxJ。5和6之间的突破性变化对我来说很难理解。
我有以下代码和以下问题。
Observable
我检查了changelog和修复破坏更改的建议,但我无法确定我需要做什么。据我所知,我的代码是旧的,没有使用管道运算符,但这就是我能弄明白的全部。
let polling = Observable.interval(2000)
.switchMap(() => this.http.get(this.videoStatusURL + this.taskID))
.subscribe(
(data) => {
if (data["state"] === "SUCCESS") {
//get final video here
console.log("polling succeeded");
this.downloadFinalVideo();
polling.unsubscribe();
}
},
error => this.handleError(error));
https://stackoverflow.com/questions/50592218
复制相似问题