[KongchangAI]
Product

DisposableEffect

A side-effect API in Jetpack Compose used for side effects that require cleanup. It is suited to processes with paired setup and teardown steps.

Timeline (last 90 days)

Oct 30

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.

Unverified50%
Oct 30

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.

Unverified50%

All Facts (2)

Source Articles