컴퓨터공부/RxJava

rxJava2 vs rxKotlin vs rxAndroid(What is the difference between them?)

achivenKakao 2020. 9. 29. 07:30

결론 부터 말하면, rxJava2, rxKotlin, rxAndroid는 Reactive Extensions(혹은 ReactiveX) 를 확장해 놓은 라이브러리이다.

쉽게 말해, 다 같은 놈이란 것이다. 이름이 여러개인 이유는, 다른 목적으로 생성 되었기 때문이다.

안드로이드에서 Kotlin을 사용해도 rxJava2를 그냥 써도 된다. 아무 이상 없다. 하지만 rxKotlin을 쓰면 보일러 플레이트 같은게 개선 되었다고 한다.

 

참고로, 

안드로이드에서 Kotlin을 사용할 때, RX를 쓰려면 한 줄

implementation "io.reactivex:rxkotlin:2.0.2"

rxjava2를 쓰려면 두 줄이 필요하다.

implementation 'io.reactivex.rxjava2:rxjava:2.2.4'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'

 

출처 발취 :

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}

 

출처 : stackoverflow.com/questions/55645167/what-is-the-difference-between-rxjava2-and-rxkotlin