将计时器与RxJS一起使用

问题描述 投票:-2回答:1

我想每10秒向一个端点发出一个请求,并在执行redux操作(POLLING_STOP)时停止请求和计时器。我使用的是react,redux,redux-observable,rxjs6.4.0。

getRatesEpic code

我从https://redux-observable.js.org/docs/recipes/Cancellation.html那里获取了代码

但我无法使用间隔/计时器http://reactivex.io/documentation/operators/timer.html使其工作。

reactjs redux rxjs redux-observable
1个回答
0
投票

解决了重构getRatesEpic的问题:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.