rx java - Converting RxJava to RxScala -
is there way use both rxjava , rxscala in 1 project?
import rx.lang.scala.{observable => scalaobservable} import rx.{observable => javaobservable}
we have module written in java using javaobservable
(rxjava). , have scala module supposed use java module written in scala.
are there convenient methods transform these other?
yes, possible using conversion functions such tojavaobservable
, toscalaobservable
, etc in rx.lang.scala.javaconversions.
you can either write conversion explicitly (eg tojavaobservable(myscalaobservable)
, or if enable implicit conversions , import rx.lang.scala.javaconversions._
, inserted automatically compiler whenever java observable expected, scala observable found, , vice versa.
Comments
Post a Comment