Compatibility
- 1.0.0 and master5.35.25.15.04.2
- 1.0.0 and masteriOSmacOS(Intel)macOS(ARM)LinuxtvOSwatchOS
Observable.throttle with custom intervals
Observable.throttle
with custom interval.
source
.throttle(dueTime: { max($1 * 2, 1) }, // (E, RxTimeInterval) -> RxTimeInterval
resetWhen: resetTrigger, // Observable<U>
latest: true,
scheduler: scheduler)
.disposed(by: disposeBag)
With the parameters above,
resetWhen
's next event.After resetWhen
, throttle interval is reset to 0 (meaning that next source
's event will be forwarded immediately)
Copy paste source file to your project for now. 👌
I'm just too lazy to support Carthage or CocoaPods. It's Saturday afternoon.
MIT