Package androidx. compose. runtime. snapshots
Types
MutableSnapshot
Link copied to clipboard
SnapshotApplyConflictException
Link copied to clipboard
An exception that is thrown when SnapshotApplyResult.check is called on a result of a MutableSnapshot.apply that fails to apply.
SnapshotApplyObserver
Link copied to clipboard
typealias SnapshotApplyObserver = (changed: Set<Any>, snapshot: Snapshot) -> Unit
Content copied to clipboard
Callback type for observing when a non-nested mutable snapshot is applied by calling MutableSnapshot.apply, modifying the visible global state of state objects. Changes to a state object outside of a snapshot are also sent to the snapshot apply observer whenever Snapshot.sendApplyNotifications is called.
The committed parameter is a collection of state objects modified in the snapshot. The snapshot parameter is the snapshot that was applied.
SnapshotApplyResult
Link copied to clipboard
sealed class SnapshotApplyResult
Content copied to clipboard
SnapshotReadObserver
Link copied to clipboard
SnapshotStateList
Link copied to clipboard
SnapshotStateMap
Link copied to clipboard
SnapshotStateObserver
Link copied to clipboard
class SnapshotStateObserver(onChangedExecutor: (callback: () -> Unit) -> Unit)
Content copied to clipboard
SnapshotWriteObserver
Link copied to clipboard
StateObject
Link copied to clipboard
interface StateObject
Content copied to clipboard
StateRecord
Link copied to clipboard
Functions
readable
Link copied to clipboard
fun <T : StateRecord> T.readable(state: StateObject, snapshot: Snapshot): T
Content copied to clipboard
snapshotFlow
Link copied to clipboard
takeMutableSnapshot
Link copied to clipboard
fun takeMutableSnapshot(readObserver: SnapshotReadObserver? = null, writeObserver: SnapshotWriteObserver? = null): MutableSnapshot
Content copied to clipboard
Take a snapshot of the current value of all state objects that also allows the state to be changed and later atomically applied when MutableSnapshot.apply is called.
takeSnapshot
Link copied to clipboard
withCurrent
Link copied to clipboard
withMutableSnapshot
Link copied to clipboard
writable
Link copied to clipboard
inline fun <T : StateRecord, R> T.writable(state: StateObject, block: T.() -> R): R
Content copied to clipboard
inline fun <T : StateRecord, R> T.writable(state: StateObject, snapshot: Snapshot, block: T.() -> R): R
Content copied to clipboard