map

fun <O> map(reversibleFunction: ReversibleFunction<T, O>): KVar<O>(source)

Create another KVar that is a bi-directional mapping of this KVar. ReversibleFunction.invoke will be called whenever this KVar changes, and the new KVar will be updated with the result of this mapping function.

Similarly, if the other KVar is modified then this KVar will be updated with the result of the ReversibleFunction.reverse function.