RxJava-Utils

More: Author   ReportBugs   
Tags:

@Tony 沈哲 on weibo License

在日常开发实践中,本人所积累的 RxJava 相关的工具类,持续更新 ing

下载

将它添加到项目的 root build.gradle 中:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

然后在项目或者在 module 中添加:

implementation 'com.github.fengzhizi715.RxJava-Utils:utils:v0.22'

Feature

  1. RetryWithDelay

    RxJava 的重连机制,需要配合 retryWhen 操作符一起使用

  2. Debounce

  • debounce()
  • debounceIf()
  • debounceAndSubscribe()
  1. CountDown
  • countDown() 倒计时函数
  1. Delay
  • delay() 延时函数
  1. Polling
  • pollingToTakeUntil() 轮询函数,当触发某个条件时轮询结束。下游会不停地收到订阅,需要自行判断
  • pollingWhenItEnd() 轮询函数,当触发某个条件时轮询结束。轮询结束时,下游才开始收到订阅
  • pollingWithLimitedNumber() 轮询函数,当触发某个条件时轮询结束,该函数会限制轮询的次数,达到轮询的次数后便不再进行轮询。
  1. AutoRefresh
  • refresh() 自动刷新的函数
  1. Extension

    为 Disposable 提供扩展函数

  • safeDispose() 安全释放 Disposable
  • isDisposed() 判断 Disposable 是否已经 Disposed
  1. RxValue、RxValueMutable
Apps
About Me
GitHub: Trinea
Facebook: Dev Tools