Interface

SnapshotMutableState

A mutable value holder where reads to the value property during the execution of a Composable function, the current RecomposeScope will be subscribed to changes of that value.

Source set: Common
public interface SnapshotMutableState<T> : MutableState<T>

A mutable value holder where reads to the value property during the execution of a Composable function, the current RecomposeScope will be subscribed to changes of that value. When the value property is written to and changed, a recomposition of any subscribed RecomposeScopes will be scheduled. Writes to it are transacted as part of the Snapshot system.

In general for correctness: Anything that is mutable, that is read during composition or written to during composition, should be a SnapshotMutableState.

Properties

policy

Source set: Common
public val policy: SnapshotMutationPolicy<T>

A policy to control how changes are handled in a mutable snapshot.

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: