onChange

fun <T> onChange(oldValue: T, newValue: T, action: () -> Unit)

Invoked when an observable property is changed.

Parameters

oldValue

Old value of the property.

newValue

New value to be assigned.

action

Lambda to be invoked if the newValue is not the same as oldValue.