I’ve currently ended up doing (much simplified) ``...
# android
g
I’ve currently ended up doing (much simplified)
Copy code
async(UI) {
delay(10)
viewState.onNext(...)
}
I guess an alternative to delay would be
Copy code
bg { Thread.sleep(10) }
?
l
You should use
launch(UI)
in your case instead of
async(UI)
.
async
creates a
Deferred
on which you're meant to call
await()
at some point. And it is not the same, because the
Thread.sleep(...)
blocks the thread (rendering it useless for the passed time), while
delay
is more like
handler.postDelayed(...)