watchingProperty

fun <V, R> watchingProperty(property: KProperty0<V>, valueChangedEvent: Event<R>? = null, cleaner: (R) -> Unit? = null, function: (value: V) -> R): PropertyWatcherDelegate<V, R>(source)

Delegate property value to a function for which the value of a single property is watched

Since

0.4.3

Parameters

property

the property for which to watch for value changes

valueChangedEvent

an optional event that is triggered on value change

cleaner

an optional cleaner function that is invoked to clean up the old value

function

a function that maps the property value to a new value