mergeWith

abstract fun <O, R> mergeWith(other: Observable<O>, merge: (T, O) -> R): Observable<R>

Combines the current observable with another observable, producing a new observable that emits values derived by applying the provided merge function to the current values of both observables.

Return

A new observable that emits values resulting from merging the two observables.

Parameters

other

The observable to be merged with the current observable.

merge

The function that combines the values from the two observables into a single value.