map

open fun <V> map(mapper: (T) -> V): Observable<V>(source)

Create a new Observable which will always have the value of mapper.apply(get()) and reports on updates accordingly. Note that even if the mapper maps two different values to the same new value, an update will still be dispatched.

Return

a new Observable

Parameters

mapper

a function to transform the value

<V>

the type of the new value