withMainContext

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

Handy equivalent of withContext to switch directly with the mainDispatcher.

Return

any object created or retrieved within this operation.

See also