mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-06 22:14:28 +00:00
Update libsession/src/main/java/org/session/libsession/snode/utilities/PromiseUtil.kt
Co-authored-by: Andrew <andrewgallasch@gmail.com>
This commit is contained in:
parent
7a8e1309fb
commit
a594952832
@ -7,7 +7,7 @@ import kotlin.coroutines.suspendCoroutine
|
|||||||
|
|
||||||
suspend fun <T, E: Throwable> Promise<T, E>.await(): T {
|
suspend fun <T, E: Throwable> Promise<T, E>.await(): T {
|
||||||
return suspendCoroutine { cont ->
|
return suspendCoroutine { cont ->
|
||||||
success { cont.resume(it) }
|
success(cont::resume)
|
||||||
fail { cont.resumeWithException(it) }
|
fail(cont::resumeWithException)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user