Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.stepango:RxKotlin:v0.60.0'
}
dependencies {
implementation("com.github.stepango:RxKotlin:v0.60.0")
}
<dependency>
<groupId>com.github.stepango</groupId>
<artifactId>RxKotlin</artifactId>
<version>v0.60.0</version>
</dependency>
libraryDependencies += "com.github.stepango" % "RxKotlin" % "v0.60.0"
:dependencies [[com.github.stepango/RxKotlin "v0.60.0"]]
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")
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'