IProperty

interface IProperty<T> : IPropertyView<T> , IMutablePropertyBase<T>

A mutable property.

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
abstract 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
abstract val change: ISource<T>

Allows to subscribe to subsequent changes of the property value. Unlike subscribing to the property directly, the callback will not be immediately called with the current value of the property.

Link copied to clipboard
open val changing: Boolean
Link copied to clipboard
abstract override var value: T

Returns the current value of the property.

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun <T> IProperty<T?>.setValue(lifetime: Lifetime, value: T?)

Sets the property value to the given value for the duration of the lifetime, and resets it to null when the lifetime is terminated.