arrow-kt / arrow-fx

Λrrow Fx is part of Λrrow, a functional companion to Kotlin's Standard Library
http://arrow-kt.io
Other
64 stars 15 forks source link

Deprecate RxJava #384

Closed nomisRev closed 3 years ago

nomisRev commented 3 years ago

Since Arrow Fx Coroutines is going to be the new way forward over IO or polymorphic effect typeclasses the Arrow Fx RxJava module is deprecated in favor of using Arrow Fx Coroutines + KotlinX Coroutines RxJava.

import kotlinx.coroutines.rx2.mono
import kotlinx.coroutines.rx2.asCoroutineDispatcher
import io.reactive.Scheduler

val single: Single<Pair<String, String>> = single {
  parMapN(Schedulers.computation().asCoroutineDispatcher(),
    { Thread.currentThread().name },
    { Thread.currentThread().name },
    ::Pair
  )
}