value

fun <T> value(initial: T, onChange: (T) -> Unit? = null): ObservableComponentProperty<T>

Creates a read write property for the components state.

When the value of the property is changed the component will redraw itself.

Parameters

initial

The initial value of the property

onChange

Callback to be called when the value has changed