Several operators exist to combine multiple observables into one. This document shows the basics of the various combining operators and shows some more advanced recipes using them.
The combineLatest
operator is used whenever you have two or more observables emitting values, and you want access to the latest value emitted from each of them whenever one of them emits a new value. It can be used, for example, to combine a username and password to make a login request:
func example(username: Observable<String>, password: Observable<String>) {
let credentials: Observable<(String, String)> = Observable.combineLatest(username, password)