【发布时间】:2019-09-17 12:19:19
【问题描述】:
我正在使用来自 Kendo UI 的 RedialGauge 和 angular。
我每 3 分钟使用 rxjs 从 api 动态加载仪表的数据,这是我的代码:
interval(2e5)
.pipe(
startWith(() => forkJoin(
this.service.getStatistics(),
this.service.otherCall()
)
),
switchMap(() => forkJoin(
this.service.getStatistics(),
this.service.otherCall()
)
),
retryWhen((err) => err.pipe(
take(3)
)
)
).subscribe(([statistics, others]) => {
this.statistics = statistics;
...
});
【问题讨论】:
-
请分享一个最小的 Stackblitz。