LaunchedEffect
A side-effect API in Jetpack Compose used to launch a coroutine within composition. It is suited to scenarios that require a coroutine scope or suspend calls.
Timeline (last 90 days)
Compose's effect APIs form a spectrum from high functionality to low latency: LaunchedEffect is the most full-featured but the most costly, DisposableEffect suits setup/teardown pairing, SideEffect with a key (introduced in Compose 1.12) is a low-cost replacement for one-off events, and the native SideEffect is the cheapest.
When migrating effect APIs, note the execution order: DisposableEffect runs first, then ordinary SideEffect, and LaunchedEffect, because it involves scheduling, does not run until after the frame ends.
All Facts (2)
Compose's effect APIs form a spectrum from high functionality to low latency: LaunchedEffect is the most full-featured but the most costly, DisposableEffect suits setup/teardown pairing, SideEffect with a key (introduced in Compose 1.12) is a low-cost replacement for one-off events, and the native SideEffect is the cheapest.
50%UnverifiedWhen migrating effect APIs, note the execution order: DisposableEffect runs first, then ordinary SideEffect, and LaunchedEffect, because it involves scheduling, does not run until after the frame ends.
50%