hackerham
12/22/2016, 3:06 PMinline suspend fun <T> vx(crossinline callback: (Handler<AsyncResult<T>>) -> Unit) = suspendCoroutine<T> { c ->
callback(Handler {
if (it.succeeded()) {
c.resume(it.result())
} else {
c.resumeWithException(it.cause())
}
})
}