Hi guys, I'm trying to convert an rxjava api base...
# coroutines
m
Hi guys, I'm trying to convert an rxjava api based into a suspend function. Can I do something like this?
Copy code
class UserApiClient(private val rxJavaBasedApi) {
    suspend fun getUser(): User = withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
        rxJavaBasedApi.getUser().blockingGet()
    }
}
Or there's a better approach?
o
m
hm... I didn't know about this lib. I'll try this. Thank's @octylFractal