IPropertyView

interface IPropertyView<out T> : IPropertyBase<T>

A read-only property that can be observed.

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

Returns the current value of the property.

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun IPropertyView<Boolean>.and(other: IPropertyView<Boolean>): IPropertyView<Boolean>
Link copied to clipboard
fun <T1, T2, TRes> IPropertyView<T1>.compose(other: IPropertyView<T2>, composer: (T1, T2) -> TRes): IPropertyView<TRes>
Link copied to clipboard
fun <T : Any> IPropertyView<T?>.debounceNotNull(timeout: Duration, scheduler: IScheduler): ISource<T?>
Link copied to clipboard
fun <T, R> IPropertyView<T>.map(f: (T) -> R): IPropertyView<R>
Link copied to clipboard
fun IPropertyView<Boolean>.not(): IPropertyView<Boolean>
Link copied to clipboard
fun IPropertyView<Boolean>.or(other: IPropertyView<Boolean>): IPropertyView<Boolean>
Link copied to clipboard
fun <T, K> IPropertyView<T>.switchMap(f: (T) -> IPropertyView<K>): IPropertyView<K>