Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import RxSwift
let disposeBag = DisposeBag()
let xmenMovies = Observable.of("First Class", "Days of Future Past", "Apocalypse")
let imdbRatings = Observable.of(7.7, 8.0, 7.0)
Observable.zip(xmenMovies, imdbRatings) { movie, rating in
"\(movie) - \(rating)"
}
.subscribe(onNext: {
print($0)
})
.disposed(by: disposeBag)
// Output:
// First Class - 7.7
// Days of Future Past - 8.0
// Apocalypse - 7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.