目录
目录README.md

RxSmartThrottle

Observable.throttle with custom interval.

Example: Exponential Backoff

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,

  • throttle interval increases exponentially (1, 2, 4, 8…),
  • until the resetWhen‘s next event.

After resetWhen, throttle interval is reset to 0 (meaning that next source‘s event will be forwarded immediately)

Install

Copy paste source file to your project for now. 👌

I’m just too lazy to support Carthage or CocoaPods. It’s Saturday afternoon.

LICENSE

MIT

关于
38.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号