androidx.compose.runtime.snapshots
Interfaces
ObserverHandle | |
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. |
StateObject |
Interface implemented by all snapshot aware state objects. |
Classes
MutableSnapshot |
A snapshot of the values return by mutable states and other state objects. |
Snapshot |
A snapshot of the values return by mutable states and other state objects. |
SnapshotApplyResult |
The result of a applying a mutable snapshot. |
SnapshotStateList |
An implementation of MutableList that can be observed and snapshot. |
SnapshotStateMap |
An implementation of MutableMap that can be observed and snapshot. |
SnapshotStateObserver | |
StateRecord |
Snapshot local value of a state object. |
Exceptions
SnapshotApplyConflictException |
An exception that is thrown when SnapshotApplyResult.check is called on a result of a MutableSnapshot.apply that fails to apply. |
Top-level functions summary
Unit |
The type returned by observer registration methods that unregisters the observer when it is disposed. |
T |
T.readable(state: StateObject) Return the current readable state record for the current snapshot. |
T |
T.readable(state: StateObject, snapshot: Snapshot) Return the current readable state record for the snapshot. |
R |
T.withCurrent(block: (r: T) -> R) Provides a block with the current record, without notifying any read observers. |
R |
T.writable(state: StateObject, snapshot: Snapshot, block: T.() -> R) Call block with a writable state record for snapshot of the given record. |
R |
T.writable(state: StateObject, block: T.() -> R) Call block with a writable state record for the given record. |
Top-level functions
<no name provided>
fun <no name provided>(): Unit
The type returned by observer registration methods that unregisters the observer when it is disposed.
readable
fun <T : StateRecord> T.readable(state: StateObject): T
Return the current readable state record for the current snapshot. It is assumed that this is the first record of state
readable
fun <T : StateRecord> T.readable(
state: StateObject,
snapshot: Snapshot
): T
Return the current readable state record for the snapshot. It is assumed that this is the first record of state
withCurrent
inline fun <T : StateRecord, R> T.withCurrent(block: (r: T) -> R): R
Provides a block with the current record, without notifying any read observers.
See Also
writable
inline fun <T : StateRecord, R> T.writable(
state: StateObject,
snapshot: Snapshot,