Interface

TaskDispatchers

Interface providing access to CoroutineDispatchers used for task execution inside a Compose hierarchy.

TaskDispatchersSample

@Sampled
@Composable
fun TaskDispatchersSample() {
    val taskDispatchers = LocalTaskDispatchers.current
    LaunchedEffect(taskDispatchers) {
        withContext(taskDispatchers.IO) {
            // Perform background I/O operations using the provided IO context
        }
    }
    Text("TaskDispatchers Sample")
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: