我有以下代码:
const reconnectorAfterPingPongFailed$ = Observable.of('timeout').delay(5000).takeUntil(this.serviceAlive$);
reconnectorAfterPingPongFailed$
.race(this.pingPong$)
.take(1)
.repeat()
.takeUntil(this.serviceAlive$)
.do(() => console.log("[ping-pong]:","repeated"))
.subscribe((data: any) => {
// some code
});
我对这段代码有什么期望?
reconnectorAfterPingPongFailed$
).next()
和.complete()
:.do()
的console.log消息serviceAlive$: Subject<void> = new Subject<void>();
.do(() => console.log("[ping-pong]:","repeated"))
仍然有效