package pl.treksoft.kvision.data import kotlin.properties.ObservableProperty import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty open class DataComponent { var container: DataUpdatable? = null fun obs(initialValue: T): ReadWriteProperty = object : ObservableProperty(initialValue) { override fun afterChange(property: KProperty<*>, oldValue: T, newValue: T) { container?.update() } } }