Function

writable

Call block with a writable state record for snapshot of the given record.

writable

Source set: Common
public inline fun <T : StateRecord, R> T.writable(
    state: StateObject,
    snapshot: Snapshot,
    block: T.() -> R,
): R

Call block with a writable state record for snapshot of the given record. It is assumed that this is called for the first state record in a state object. If the snapshot is read-only calling this will throw.

writable

Source set: Common
public inline fun <T : StateRecord, R> T.writable(state: StateObject, block: T.() -> R): R

Call block with a writable state record for the given record. It is assumed that this is called for the first state record in a state object. A record is writable if it was created in the current 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: