Created
September 5, 2022 17:19
-
-
Save aleksandarzekovic/c4dd5fbec1f92e8b3ad6aab92b47140d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@InternalCoroutinesApi | |
public fun <T> Continuation<T>.resumeCancellableWith( | |
result: Result<T>, | |
onCancellation: ((cause: Throwable) -> Unit)? = null | |
): Unit = when (this) { | |
is DispatchedContinuation -> resumeCancellableWith(result, onCancellation) | |
else -> resumeWith(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment