Observe

class Observe<T>

Observe an object, when the object's value changed, the callback will be auto invoked.

Constructors

Link copied to clipboard
constructor(init: T, onValueChanged: IOnValueChangedEvent<T>? = null)
constructor(init: T, onValueChanged: (T) -> Unit? = null)
constructor(init: T)

Properties

Link copied to clipboard
Link copied to clipboard
var value: T

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun invoke(newVal: T)
operator fun invoke(block: () -> T)

Set the new value for the object.

Link copied to clipboard
operator fun minusAssign(listener: IOnValueChangedEvent<T>)
operator fun minusAssign(listener: (T) -> Unit)
Link copied to clipboard
operator fun plusAssign(listener: IOnValueChangedEvent<T>)
operator fun plusAssign(listener: (T) -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard