Created
March 22, 2019 08:45
-
-
Save tomi/4dd991ff05055b082d3adbbfe6c183cc to your computer and use it in GitHub Desktop.
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
import { from } from "fromfrom"; | |
var sequence = from([1, 2, 3, 4]) | |
.map(x => { | |
console.log(x); | |
return x; | |
}) | |
.map(x => x * 2) | |
.take(1) | |
.toArray(); // Needed to force the evaluation | |
// Only 1 is printed to the console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment