CompositionEffectContext

Marks integration-owned effect callbacks that run after their declaring provider stack returns.

Standard ViewCompose effects install this marker automatically. An integration implementing a new callback or coroutine effect uses run or adds coroutineContext so a composition-local read fails with the Local's diagnostic name instead of silently selecting a default or an unrelated provider active on the callback thread. This marker does not restore Locals; integrations still capture resolved values during declaration. Nested markers are supported and restored in finally blocks.

Application code normally uses SideEffect, DisposableEffect, LaunchedEffect, or lifecycle effects instead of calling this low-level integration API directly.

Samples

CompositionEffectContext.run(callback)

Properties

Link copied to clipboard

Returns an immutable coroutine context element that marks every resumed callback as an effect.

Functions

Link copied to clipboard
fun <T> run(block: () -> T): T

Runs block as an integration-owned synchronous effect callback.