Disposer

Additional

Language
Kotlin
Version
v2.0.0 (Feb 3, 2019)
Created
Sep 29, 2018
Updated
Feb 3, 2019
Owner
Sebastian Sellmair (sellmair)
Contributors
Fabian Terhorst (FabianTerhorst)
Sebastian Sellmair (sellmair)
2
Activity
Badge
Generate
Download
Source code
APK file

Show card

Disposer

Easily dispose RxJava streams with Android's Lifecycle

Checkout my Medium article.

Usage

Gradle
dependencies {
    // Non AndroidX projects
    implementation 'io.sellmair:disposer:1.1.0'
    
    // AndroidX projects
    implementation 'io.sellmair:disposer:2.0.0'
}


Or a much sweeter apis, that might look familiar to rxKotlin users:

val disposer: Disposer = /* ... */
disposer += Service.queryAwesomeData().subscribe() // Managed by the disposer
val disposer: Disposer = /* ... */
Service.queryAwesomeData().subscribe().disposeBy(disposer) // Managed by the disposer