Created
October 11, 2014 14:24
-
-
Save bekzod/ce3d22c985d79805f891 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
| var Step = require('step'); | |
| function someFunc(i, callback){ | |
| function cbWrapper(){ callback(undefined, i); } | |
| i % 2 == 0 ? cbWrapper() : setTimeout(cbWrapper, 10); | |
| } | |
| Step( | |
| function process(){ | |
| var group = this.group(); | |
| for(var i = 0; i < 10; i++){ | |
| someFunc(i, group() ); | |
| } | |
| }, | |
| function end(err, data){ | |
| console.log(err || data); | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment