![JAR search and dependency download from the Maven repository](/logo.png)
io.reactivex.rxkotlin.completable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxkotlin Show documentation
Show all versions of rxkotlin Show documentation
RxJava bindings for Kotlin
package io.reactivex.rxkotlin
import io.reactivex.Completable
import io.reactivex.Flowable
import io.reactivex.Observable
import io.reactivex.functions.Action
import java.util.concurrent.Callable
import java.util.concurrent.Future
fun Action.toCompletable(): Completable = Completable.fromAction(this)
fun Callable.toCompletable(): Completable = Completable.fromCallable(this)
fun Future.toCompletable(): Completable = Completable.fromFuture(this)
fun (() -> Any).toCompletable(): Completable = Completable.fromCallable(this)
// EXTENSION FUNCTION OPERATORS
/**
* Merges the emissions of a Observable. Same as calling `flatMapSingle { it }`.
*/
fun Observable.mergeAllCompletables() = flatMapCompletable { it }
/**
* Merges the emissions of a Flowable. Same as calling `flatMap { it }`.
*/
fun Flowable.mergeAllCompletables() = flatMapCompletable { it }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy