registerBeforeChangeUpdateListener

fun registerBeforeChangeUpdateListener(onValueUpdateListener: (T, T) -> Boolean): DisposableHandle(source)

Registers a listener that is invoked before the property's value changes.

The listener receives the old and new values as arguments and should return true to allow the change, or false to prevent it.

Return

A DisposableHandle that can be used to unregister the listener by calling DisposableHandle.dispose.

Parameters

onValueUpdateListener

The listener function to register. It takes the old value (T) and the new value (T) as input and returns a Boolean indicating whether the change should proceed.