observable<T> static method

ReadWriteProperty<Any?, T> observable<T>(
  1. T initialValue,
  2. void onChange(
    1. KProperty<T> property,
    2. T oldValue,
    3. T newValue
    )
)

Returns a property delegate for a read/write property that calls a specified callback function when changed.

Parameters:

  • initialValue - the initial value of the property.
  • onChange - the callback which is called after the change of the property is made. The value of the property has already been changed when this callback is invoked.

Implementation

external static ReadWriteProperty<Any?, T> observable<T>(
  T initialValue,
  Unit Function(KProperty<T> property, T oldValue, T newValue) onChange,
);