Convert RxJava to RxScala

Is there a way to use RxJava and RxScala in the same project?

import rx.lang.scala.{Observable => ScalaObservable}
import rx.{Observable => JavaObservable}

We have a module written in Java that uses JavaObservable(RxJava). And then we have a Scala module that should use the Java module, but written in Scala.

Are there convenient methods for converting them to others?

+4
source share
1 answer

Yes, it is possible with conversion functions such as toJavaObservable, toScalaObservableetc. in rx.lang.scala.JavaConversions .

(, toJavaObservable(myScalaObservable), import rx.lang.scala.JavaConversions._, , Java Observable, Scala Observable, .

+4

Source: https://habr.com/ru/post/1627744/


All Articles