Switch to using coroutines. You can't use Rx that ...
# android
k
Switch to using coroutines. You can't use Rx that way...has nothing to do with Kotlin...
g
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
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
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
@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
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.