Created
May 30, 2013 08:02
-
-
Save timoxley/5676388 to your computer and use it in GitHub Desktop.
probably need to pause?
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
| from = require('from') | |
| through = require('through') | |
| concat = require('concat-stream') | |
| from([1,2,3,4,5]) | |
| .pipe(through(function(data) { | |
| setTimeout(function(){ | |
| console.log('pushing data', data) | |
| this.push(data) | |
| }.bind(this), 300) | |
| })).pipe(through(function(data) { | |
| console.log('pushing data second time', data); | |
| this.push(data) | |
| })).pipe(concat(function(result) { | |
| console.log("voila", result) | |
| })) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output: