Skip to content

Instantly share code, notes, and snippets.

@yelouafi
Created July 17, 2015 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yelouafi/cd56bbf261c6fcacc1d5 to your computer and use it in GitHub Desktop.
Save yelouafi/cd56bbf261c6fcacc1d5 to your computer and use it in GitHub Desktop.
Stream.prototype.log = function(prefix) {
this.forEach(
v => console.log(prefix, v),
err => console.log(prefix, ' error!!', err),
() => console.log(prefix, ' end.')
);
}
Stream.seq([1,2,3], 0, 1000).log('seq')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment