``` inline suspend fun <T> vx(crossinline ca...
# coroutines
d
Copy code
inline suspend fun <T> vx(crossinline callback: (Handler<AsyncResult<T>>) -> Unit) = suspendCoroutine<T> { c->
    callback(object : Handler<AsyncResult<T>> {
        override fun handle(event: AsyncResult<T>) {
            if (event.succeeded()) {
                c.resume(event.result())
            } else {
                c.resumeWithException(event.cause())
            }
        }
    })
}