user
03/05/2017, 11:05 AMsuspend fun fetchDataAsync() = suspendCoroutine { c: Continuation<Any> ->
val listener = object : Listener {
override fun onSuccess(value: Any) {
c.resume(value);
}
override fun onError(throwable: Throwable) {
c.resumeWithException(throwable);
}
}
// add listener ...
}
(edited)