RxJava bindings for Kotlin
Kotlin Shell
Latest commit df9dc28 Jan 8, 2017 @stepango stepango committed on GitHub Merge pull request #86 from thomasnield/observable-observable-operators
implement Observable<Observable<T>> extension functions

README.md

Kotlin Adaptor for RxJava

This adaptor exposes a set of Extension functions that allow a more idiomatic Kotlin usage

observable<String> { subscriber ->
    subscriber.onNext("H")
    subscriber.onNext("e")
    subscriber.onNext("l")
    subscriber.onNext("")
    subscriber.onNext("l")
    subscriber.onNext("o")
    subscriber.onCompleted()
}.filter { it.isNotEmpty() }
.fold (StringBuilder()) { sb, e -> sb.append(e) }
.map { it.toString() }
.subscribe { a.received(it) }

verify(a, times(1)).received("Hello")

Build

Build Status

Binaries

Binaries and dependency information for Maven, Ivy, Gradle and others can be found at http://search.maven.org.

Example for Maven:

<dependency>
    <groupId>io.reactivex</groupId>
    <artifactId>rxkotlin</artifactId>
    <version>x.y.z</version>
</dependency>

and for Ivy:

<dependency org="io.reactivex" name="rxkotlin" rev="x.y.z" />

and for Gradle:

compile 'io.reactivex:rxkotlin:x.y.z'