applyMirror

fun applyMirror(mirror: MirrorState<*>)

Applies mirror to this node, so the mirror belongs to it - which is what lets MirrorState.report answer a change inside the event that made it rather than from an event of its own.

declare states it for the declaration it settles, so a component built the usual way needs nothing here. State it directly where a component settles a mirror some other way - applying two declarations the widget resolves together, or reading back a property no declaration is written through. A mirror that reports without it fails at the first change.

Runs once, on the pass that creates the node. A report settles in the composition the node stands in at the time, so it follows the node into another composition.

Parameters

mirror

the record whose reports settle in this node's composition. Remember it in this node's own group, so it is released with the node it answers for.