Skip to content

Instantly share code, notes, and snippets.

@tomi
Created March 22, 2019 08:44
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/202c35caf7cfd2078f99fc6b6b4fb721 to your computer and use it in GitHub Desktop.
Save tomi/202c35caf7cfd2078f99fc6b6b4fb721 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;
})
.filter(x => x > 2);
// Nothing is printed the console yet
var result = sequence.toArray(); // .toArray() forces the evaluation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment