-
-
Save getify/e94ea48190e9523fcf9b 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
//In asynquence-contrib | |
var emptyItems = [], | |
sq = ASQ(); | |
sq.map(emptyItems, function(item, done){ | |
// do some things to item | |
item.values = []; | |
done(item); | |
}); | |
sq.map(function(item, done) { | |
ASQ().map(item.values, function(value, valueDone) { | |
valueDone(value); | |
}); | |
}); |
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
//In asynquence-contrib | |
var emptyItems = [], | |
sq = ASQ(); | |
sq.map(emptyItems, function(item, done){ | |
// do some things to item | |
item.values = []; | |
done(item); | |
}); | |
sq.map(function(item, done) { | |
ASQ().map(item.values, function(value, valueDone) { | |
valueDone(value); | |
}) | |
.pipe(done); // <-- you need this line | |
}); | |
sq.val(function(items){ | |
console.log(items); // an array of `{ values: [..] }` tuples | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment