14 lines
No EOL
457 B
Kotlin
14 lines
No EOL
457 B
Kotlin
package de.kif.frontend
|
|
|
|
import org.w3c.dom.*
|
|
import kotlin.coroutines.Continuation
|
|
import kotlin.coroutines.CoroutineContext
|
|
import kotlin.coroutines.EmptyCoroutineContext
|
|
import kotlin.coroutines.startCoroutine
|
|
|
|
fun launch(context: CoroutineContext = EmptyCoroutineContext, block: suspend () -> Unit) =
|
|
block.startCoroutine(Continuation(context) { result ->
|
|
result.onFailure { exception ->
|
|
console.error(exception)
|
|
}
|
|
}) |