Skip to content
Extension functions and delegates for RxJava
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.idea
app
gradle/wrapper
rxextensions
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

RxHelpers

Extension functions and delegates for RxJava

CircleCI Download

This app provides a few extension functions and delegates for RxJava in Kotlin

Installation

implementation 'com.jacquessmuts:rxhelpers:{version}'

Usage

Extension Description Example
.filterRapidClicks() Throttles out events within 300ms Example
.subscribeAndLogE{} Same as .subscribe{}, except it logs an error by default. Example
.computationThread() Same as observeOn(Schedulers.computation()) Example
.uiThread() Same as observeOn(AndroidSchedulers.mainThread()) Example
Delegate Description Example
LazyPublishSubject<> Creates a lazy-loaded PublishSubject<> Example

Setting Defaults

You can set the default handling of some functions. Do it in the onCreate of your application.

RxHelper.setDefaultErrorHandling { throwable ->
    // Every time .subscribeAndLogE catches an error, this will run
    Timber.e(throwable)
}

// events faster than 500ms will be filtered out by .filterRapidClick()
RxHelper.setMaximumClickRapidity(500)
You can’t perform that action at this time.