notifyStateChanged

fun notifyStateChanged(oldState: T, newState: T)

Notifies all registered observers of a state change.

Observers are notified in the order they were registered. If an observer throws an exception, it is caught and logged, but does not affect other observers or the notification process.

Parameters

oldState

The previous state

newState

The new state