Skip to content

Instantly share code, notes, and snippets.

@broguinn
Created January 23, 2015 17:23
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 broguinn/78255067e40b0c97e8cd to your computer and use it in GitHub Desktop.
Save broguinn/78255067e40b0c97e8cd to your computer and use it in GitHub Desktop.
ASQ map
//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) {
// iterates once, throws
// "Type Error: cannot read property `values` of undefined"
ASQ().map(item.values, function(value, valueDone) {
valueDone(value);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment