Skip to content

Instantly share code, notes, and snippets.

@tomi
Created March 22, 2019 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomi/4dd991ff05055b082d3adbbfe6c183cc to your computer and use it in GitHub Desktop.
Save tomi/4dd991ff05055b082d3adbbfe6c183cc to your computer and use it in GitHub Desktop.
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