Skip to content

Instantly share code, notes, and snippets.

@ourmaninamsterdam
Last active October 16, 2019 14:08
Show Gist options
  • Save ourmaninamsterdam/4d9de9feaca939d6f0a1666c2c30d3da to your computer and use it in GitHub Desktop.
Save ourmaninamsterdam/4d9de9feaca939d6f0a1666c2c30d3da to your computer and use it in GitHub Desktop.
RxJS quick example of switching between array and stream
Rx.Observable.range(1, 10)
.toArray()
.mergeMap(items => Rx.Observable.from(items))
.map(a => a + a)
.subscribe({
next(items) {
console.log(items);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment