<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Effects and retained lifetimes on Staticvar Learn</title><link>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/</link><description>Recent content in Effects and retained lifetimes on Staticvar Learn</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/index.xml" rel="self" type="application/rss+xml"/><item><title>Side effects run after a successful apply</title><link>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/01-side-effect-after-apply/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/01-side-effect-after-apply/</guid><description>Status: The rule that a side effect must not publish an un-applied result is Durable . The precise dispatcher sequence below is Version-specific .
Outcome Explain why a SideEffect can safely update an object outside snapshots only after changes apply, and why DisposableEffect is a remembered observer rather than code that runs during the composable body.
The body records; apply dispatches Calling SideEffect { ... } does not run the lambda.</description></item><item><title>LaunchedEffect belongs to a keyed composition scope</title><link>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/02-launched-effect-and-scope-ownership/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/02-launched-effect-and-scope-ownership/</guid><description>Status: An effect coroutine owned by a composition point is Durable . Its parent context, cancellation exception, and lazy scope internals are Version-specific .
Outcome Given a LaunchedEffect or rememberCoroutineScope call, identify who owns the Job, what a key change means, and why callback-started work should use a remembered scope instead of using state as a launch trigger.
LaunchedEffect has a remembered owner At the pinned source, LaunchedEffect(key...) reads currentComposer.</description></item><item><title>Remember, retain, and saved state are different lifetimes</title><link>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/03-remember-retain-and-saved-lifetimes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/03-remember-retain-and-saved-lifetimes/</guid><description>Status: The distinction between slot, retained-memory, saved-state, and process lifetimes is Durable . The retention-store protocol and current release mapping are Version-specific .
Outcome Given a value and a destruction event, predict whether it is recreated, restored from memory, restored from saved state, or lost with the process—and name the owner that decides.
Four owners, four failure modes remember is composition memory. Its calculation is cached in a slot and reused while the remembered identity remains in the composition; when that group is forgotten, the slot value is no longer an owner of the value.</description></item><item><title>Retention has its own store and observer lifecycle</title><link>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/04-retained-store-observers-and-effects/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://learn.staticvar.dev/courses/jetpack-compose-internals/08-effects-and-retained-lifetimes/04-retained-store-observers-and-effects/</guid><description>Status: Retention needs an owner beyond the slot table and therefore has a distinct callback vocabulary: Durable . Exact store handoffs, callback order, and lint enforcement are Version-specific .
Outcome Trace a retained object through successful retention, composition exit, restoration or retirement, and cleanup. Explain why RetainedEffect is not just DisposableEffect with a longer delay.
The store owns the gap after forgetting RetainedValuesStore defines the handoff around transient removal. Before owned content exits, onContentExitComposition tells the store to prepare.</description></item></channel></rss>