withMainContext

inline suspend fun <T> withMainContext(crossinline block: suspend CoroutineScope.() -> T): T

This uses withContext([Dispatchers.Main]) for suspend functions.

Parameters

block

The suspend function to run.

See also