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