report

fun report(published: V, onChanged: (V) -> Unit)

Carries a value the widget published to the caller: mirrors published through observed and, where that is a change of the user's, hands it to onChanged and settles the composition on the answer - inside the event that made the change wherever a frame can run there, so the declaration is back on the widget before the repaint that change asked for is served. Where one cannot, the pass follows a later event, as it does for a change only observed.

This is how a widget property the user can also change is reported. onChanged runs first and settling follows it, so a caller that adopts the change is settled on what it wrote and one that does not is settled back onto its standing declaration.

Report a discrete interaction this way - a click, a selection, a step. A continuous gesture reports a change per drag step, and the value one step lands on is replaced by the next well inside a display refresh interval, so there is nothing visible to correct and batching the steps is worth more than the pass: mirror a gesture through observed instead. A change carried on a second channel behind a listener the caller supplied goes the same way: that channel fires before the caller's own and would settle the widget against a declaration the caller is about to change.

Runs on the event dispatch thread.

Parameters

published

the value the widget now holds, mirrored through observed even where it is no change of the user's.

onChanged

handed published where the change is the user's, and not called at all where it is not.