mainDispatcher

val CoroutineScope.mainDispatcher: CoroutineDispatcher

Extracts the mainCoroutineDispatcher out of the CoroutineScope, using DefaultDispatcherProvider.get to provide one if necessary.

Note that CoroutineContext is immutable, so if a new DefaultDispatcherProvider is needed, a new instance will be created each time.

See also

Sources

Link copied to clipboard