Skip to content

Instantly share code, notes, and snippets.

@mariusk
Created January 22, 2015 21:59
Show Gist options
  • Save mariusk/dde96359ba4087b2d05a to your computer and use it in GitHub Desktop.
Save mariusk/dde96359ba4087b2d05a to your computer and use it in GitHub Desktop.
arr = [false, false, false, true, false, false, true, false, true, false]
Rx.Observable.from(arr)
.pairwise().filter((val) -> val[0])
.map((val) -> Rx.Observable.from val)
.concatAll()
.subscribe(
(val) -> console.log "val", val
)
# Outputs:
# val true
# val false
# val true
# val false
# val true
# val false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment