MutableObservables

Factory and utilities for mutable observables.

Functions

Link copied to clipboard
fun <T> observe(initial: T, emitOnDistinct: Boolean = true): MutableObservable<T>

Creates and returns a new instance of a MutableObservable initialized with the given value. The resulting observable allows its state to be modified and notifies registered observers of any changes.

Link copied to clipboard
fun <T> MutableObservable<Option<T>>.updateValue(updateFunc: (T) -> T)

Handy method to update the optionalOption contents of this MutableObservable. Applies the given function to the value contained by the underlying Option, if it is empty nothing is computed.