Last active
October 16, 2019 14:08
-
-
Save ourmaninamsterdam/4d9de9feaca939d6f0a1666c2c30d3da to your computer and use it in GitHub Desktop.
RxJS quick example of switching between array and stream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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