Hi everyone, i'm really loving coroutines and woul...
# coroutines
i
Hi everyone, i'm really loving coroutines and would like to know if there's a
suspendCoroutine
version without return type, that would allow me to just call resume(). Currently, i'm using the following when ignoring the result:
Copy code
suspend fun <T : AppCompatActivity> T.awaitRunOnUi(fn: T.() -> Unit) {
    suspendCoroutine<Any> { continuation ->
        runOnUiThread {
            fn()
            continuation.resume(0)
        }
    }
}
Getting rid of the <Any> and the 0 (or anything else) on the resume would be nice for lazy people like me xD.