https://kotlinlang.org logo
Title
k

kenkyee

11/09/2017, 11:28 AM
Switch to using coroutines. You can't use Rx that way...has nothing to do with Kotlin...
g

gildor

11/09/2017, 12:07 PM
Why? I completely disagree with it. Kotlin and Rx can be used together as with any other language, and Kotlin allow to use RxJava even more effective in terms of syntax than Java. If you don't like reactive approach or rxjava it's fine, but Kotlin definitely don't push you to drop rxjava, also switch to coroutines it's too big step to recommend it for someone who not familiar with them
And yeah, Rx can be used that way
p

Paul Woitaschek

11/09/2017, 1:06 PM
and Kotlin allow to use RxJava even more effective in terms of syntax than Java.
If there were not that huge type inference issue 😉
k

kenkyee

11/09/2017, 2:03 PM
He's returning a value from a subscribe. That looks like the classic async await pattern which would be a lot easier with coroutines
g

gildor

11/10/2017, 6:57 AM
@paulmarino true, but not so big problem on rxjava1 (still on 1.x)
@kenkyee yes, but one small case is definitely not a reason itself for such radical steps
k

kenkyee

11/10/2017, 12:26 PM
True... From all the "?!" In the kotlin, I thought he was just experimenting. Should have asked first 😀 What he wanted to do was definitely simpler with coroutines.