mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-06-03 00:15:15 +00:00
11 lines
286 B
Kotlin
11 lines
286 B
Kotlin
|
package dev.inmo.micro_utils.coroutines
|
||
|
|
||
|
import kotlinx.coroutines.CoroutineScope
|
||
|
import kotlinx.coroutines.Dispatchers
|
||
|
import kotlinx.coroutines.withContext
|
||
|
|
||
|
suspend inline fun <T> doInUI(noinline block: suspend CoroutineScope.() -> T) = withContext(
|
||
|
Dispatchers.Main,
|
||
|
block
|
||
|
)
|