diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/data/DataComponent.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/data/DataComponent.kt b/src/main/kotlin/pl/treksoft/kvision/data/DataComponent.kt index 605e1e2e..6eef6f98 100644 --- a/src/main/kotlin/pl/treksoft/kvision/data/DataComponent.kt +++ b/src/main/kotlin/pl/treksoft/kvision/data/DataComponent.kt @@ -4,8 +4,8 @@ import kotlin.properties.ObservableProperty import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty -open class DataComponent { - var container: DataUpdatable? = null +interface DataComponent { + var container: DataUpdatable? fun <T> obs(initialValue: T): ReadWriteProperty<Any?, T> = object : ObservableProperty<T>(initialValue) { override fun afterChange(property: KProperty<*>, oldValue: T, newValue: T) { @@ -13,3 +13,7 @@ open class DataComponent { } } } + +open class BaseDataComponent : DataComponent { + override var container: DataUpdatable? = null +} |