Skip to content

Instantly share code, notes, and snippets.

@TheCodedSelf
Created May 13, 2017 17:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheCodedSelf/df4d0eda9a73dec590353a572cd14975 to your computer and use it in GitHub Desktop.
Save TheCodedSelf/df4d0eda9a73dec590353a572cd14975 to your computer and use it in GitHub Desktop.
RxSwift - Merge the results of multiple Observables
import Foundation
import RxSwift
let cars = Observable.from(["Nissan", "Ford", "BMW"])
let tanks = Observable.from(["Tiger II", "T-44", "Panther"])
let bikes = Observable.from(["Ducati", "Honda", "Kawasaki"])
let landVehicles = Observable.of(cars, tanks, bikes).merge()
landVehicles.subscribe(onNext: { print($0) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment