MapObservable

An observable that wraps another observable and applies a mapper function to its content.

Parameters

<T>

the type of the wrapped observable

<V>

the type of the mapped observable

See also

Functions

Link copied to clipboard
open fun addObserver(observer: Observer<T>)
Add a new observer which is interested in updates about this value
Link copied to clipboard
open fun get(): V
Link copied to clipboard
open fun isValid(): Boolean
A method to indicate whether an observer is still valid.
Link copied to clipboard
open fun <V> map(mapper: (T) -> V): Observable<V>
Create a new Observable which will always have the value of mapper.apply(get()) and reports on updates accordingly.
Link copied to clipboard
open fun observeChange(oldT: T, newT: T)
Called when the state is changed.
Link copied to clipboard
open fun whenChanged(observer: Observer<T>)
Alias for addObserver.