Skip to content

Instantly share code, notes, and snippets.

@andreaslydemann
Created January 28, 2019 21:10
Show Gist options
  • Select an option

  • Save andreaslydemann/548e6e04108715269892373b694ed2cb to your computer and use it in GitHub Desktop.

Select an option

Save andreaslydemann/548e6e04108715269892373b694ed2cb to your computer and use it in GitHub Desktop.
import RxSwift
let disposeBag = DisposeBag()
let oldXmenMovies = Observable.of("X-Men", "X-Men United", "The Last Stand")
let newXmenMovies = Observable.of("First Class", "Days of Future Past", "Apocalypse")
oldXmenMovies.concat(newXmenMovies)
.subscribe(onNext: { movie in
print(movie)
})
.disposed(by: disposeBag)
// Output:
// X-Men
// X-Men United
// The Last Stand
// First Class
// Days of Future Past
// Apocalypse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment