Skip to content

Instantly share code, notes, and snippets.

@50percentgrey
Created February 27, 2019 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 50percentgrey/8ba1ad0f609d8215c5fe17e2c945bb02 to your computer and use it in GitHub Desktop.
Save 50percentgrey/8ba1ad0f609d8215c5fe17e2c945bb02 to your computer and use it in GitHub Desktop.
Extract Value from Observable
let obs1 = Observable.just(FakeObject(blood: [0,1], producers: [100,101]))
let obs2 = Observable.just(FakeObject(blood: [3,4], producers: [300,401]))
let objs = [Observable.just(obs1), Observable.just(obs2)]
// [Observable<Observable[FakeObject]>] to [FakeObject]
Observable.combineLatest(vitals)
.flatMap { Observable.combineLatest($0) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment