Search code examples
androidkotlinrx-java2rx-kotlin

What is the difference between rxjava2 and rxkotlin?


What is the difference between rxjava2 dependency and rxkotlin dependency. If I'm using rxkotlin dependency, should i need to add rxjava2 dependency along with that.

implementation 'io.reactivex.rxjava2:rxkotlin:x.y.z'
// do i need to add the below dependencies also?
implementation 'io.reactivex.rxjava2:rxjava:2.2.4'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'

Solution

  • the thing is RX stands for Reactive Extensions , and Rx Java , Rx Kotlin or Rx Swift all are the implementation of Reactive Extensions in that particular language.

    What is RxJAVA? RxJava is a Java VM implementation of Reactive Extensions. where we can create asynchronous data stream on any thread, transform it and these asynchronous data streams can be consumed by Observers on any thread.

    What is RxKotlin? RxKotlin is a Kotlin implementation of Reactive Extensions.

    What is RxAndroid? It is specific to Android Platform with some more added classes on top of RxJava.

    for more details , visit my collection of rxjava simple examples https://github.com/myJarvis/Intro_to_RxJava .

    and to more clarify , RxKotlin has some convenient extension functions which comes with Kotlin.

    You can either use {RxJava & RxAndroid} or {RxKotlin}

    You can use RxJava with Kotlin out-of-the-box