A helper receiver scope class used by ComposeNode to help write code to initialized and update a node.

See also
ComposeNode

Summary

Public constructors

<T : Any?> Updater(composer: Composer)
Cmn

Public functions

Unit
init(block: T.() -> Unit)

Initialize emitted node.

Cmn
Unit
reconcile(block: T.() -> Unit)

Reconcile the node to the current state.

Cmn
inline Unit
set(value: Int, noinline block: T.(value: Int) -> Unit)

Set the value property of the emitted node.

Cmn
Unit
<V : Any?> set(value: V, block: T.(value) -> Unit)

Set the value property of the emitted node.

Cmn
inline Unit
update(value: Int, noinline block: T.(value: Int) -> Unit)

Update the value of a property of the emitted node.

Cmn
Unit
<V : Any?> update(value: V, block: T.(value) -> Unit)

Update the value of a property of the emitted node.

Cmn

Public constructors

Updater

<T : Any?> Updater(composer: Composer)

Public functions

init

fun init(block: T.() -> Unit): Unit

Initialize emitted node.

Schedule block to be executed after the node is created.

This is only executed once. The can be used to call a method or set a value on a node instance that is required to be set after one or more other properties have been set.

See also
reconcile

reconcile

fun reconcile(block: T.() -> Unit): Unit

Reconcile the node to the current state.

This is used when set and update are insufficient to update the state of the node based on changes passed to the function calling ComposeNode.

Schedules block to execute. As this unconditionally schedules block to executed it might be executed unnecessarily as no effort is taken to ensure it only executes when the values block captures have changed. It is highly recommended that set and update be used instead as they will only schedule their blocks to executed when the value passed to them has changed.

set

inline fun set(value: Int, noinline block: T.(value: Int) -> Unit): Unit

Set the value property of the emitted node.

Schedules block to be run when the node is first created or when value is different than the previous composition.

See also
update

set

fun <V : Any?> set(value: V, block: T.(value) -> Unit): Unit

Set the value property of the emitted node.

Schedules block to be run when the node is first created or when value is different than the previous composition.

See also
update

update

inline fun update(value: Int, noinline block: T.(value: Int) -> Unit): Unit

Update the value of a property of the emitted node.

Schedules block to be run when value is different than the previous composition. It is different than set in that it does not run when the node is created. This is used when initial value set by the ComposeNode in the constructor callback already has the correct value. For example, use [update} when value is passed into of the classes constructor parameters.

See also
set

update

fun <V : Any?> update(value: V, block: T.(value) -> Unit): Unit

Update the value of a property of the emitted node.

Schedules block to be run when value is different than the previous composition. It is different than set in that it does not run when the node is created. This is used when initial value set by the ComposeNode in the constructor callback already has the correct value. For example, use [update} when value is passed into of the classes constructor parameters.

See also
set