Skip to content

Instantly share code, notes, and snippets.

@trxcllnt
Created January 25, 2013 20:55
Show Gist options
  • Select an option

  • Save trxcllnt/4637767 to your computer and use it in GitHub Desktop.

Select an option

Save trxcllnt/4637767 to your computer and use it in GitHub Desktop.
combineLatest, merge, expand
merge = [].concat
expand = (fn, context) -> (args) -> fn.apply context, args.slice 0, fn.length
obs1 = Rx.Observable.returnValue(1)
obs2 = Rx.Observable.returnValue(2)
obs3 = Rx.Observable.returnValue(3)
combined = obs1.combineLatest(obs2, merge).combineLatest(obs3, merge)
combined.subscribe expand (o1, o2, o3) -> o1 + o2 + o3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment