package application.model import kotlin.properties.Delegates class ObservableReplayState { val listeners: MutableList = mutableListOf() var value: Boolean by Delegates.observable( initialValue = true, onChange = { _, _, new -> run { listeners.forEach { it.onValueChanged(new) } } } ) }