RxSwift - withLatestFrom combining values from both observables
Short version where your R = input.r and L = input.l
let output = input.r
.withLatestFrom(input.l) { ($0, $1) }
Just use resulting selector from your withLatestFrom
. The overloaded implementation without closure simply ignores first observable. For example:
Observable.just("one")
.withLatestFrom(Observable.just(1))
{ oneAsString, oneAsInt in return (oneAsString, oneAsInt) }