【发布时间】:2018-06-21 05:48:47
【问题描述】:
你会如何在 rxjs 中延迟 .forkJoin()?
这是我所拥有的,但想使用 delay() 运算符?
return forkJoin(
this.call1(),
this.call2(),
this.call3()
);
到目前为止,我得到了这个:
return of(null).pipe(
delay(5000),
switchmap(() => this.call1()),
switchmap(() => this.call2()),
switchmap(() => this.call3()))
);
这可行,但我想使用 forkJoin,我尝试了其他解决方案
return forkJoin(
of(this.call1()).pipe(delay(5000)),
of(this.call2()).pipe(delay(5000)),
of(this.call3()).pipe(delay(5000))
);
但是好像不行。
【问题讨论】: