Forgot to commit ObjectReference which is already used for some time
This commit is contained in:
parent
4ddb55e612
commit
bc6e8aed51
|
@ -0,0 +1,21 @@
|
|||
package net.dankito.utils.multiplatform
|
||||
|
||||
|
||||
open class ObjectReference<T>(
|
||||
value: T?,
|
||||
open val valueChangedListener: ((T?) -> Unit)? = null
|
||||
) {
|
||||
|
||||
open var value: T? = value
|
||||
set(value) {
|
||||
field = value
|
||||
|
||||
valueChangedListener?.invoke(value)
|
||||
}
|
||||
|
||||
|
||||
override fun toString(): String {
|
||||
return "$value"
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue