Property

class Property<T>(defaultValue: T) : IProperty<T>

Constructors

Link copied to clipboard
fun <T> Property(defaultValue: T)

Functions

Link copied to clipboard
open override fun advise(lifetime: Lifetime, handler: (T) -> Unit)

Adds an event subscription. Every time an event occurs, the handler is called, receiving an instance of the event. The subscription is removed when the given lifetime expires.

Link copied to clipboard
open operator fun invoke(): T
Link copied to clipboard
open override fun set(newValue: T)

Sets the property to the given value.

Link copied to clipboard
open override fun view(lifetime: Lifetime, handler: (Lifetime, T) -> Unit)

Adds a subscription to changes of the contents of the object.

Properties

Link copied to clipboard
open override val change: ISource<T>
Link copied to clipboard
open val changing: Boolean
Link copied to clipboard
open override var value: T

Returns the current value of the property.