Skip to content

Instantly share code, notes, and snippets.

@wei-lee
Created July 8, 2015 09:17
Show Gist options
  • Save wei-lee/98ad544bbfbead121955 to your computer and use it in GitHub Desktop.
Save wei-lee/98ad544bbfbead121955 to your computer and use it in GitHub Desktop.
create variants
async.waterfall(
[
function getVariants(callback){
//get variants, pass them to the callback
return callback(null, variants);
},
function(variants, callback){
//if variants is an array, you can nest more async functions
async.map(variants, function(variant, cb){
//create variant
cb(null, result);
}, callback);
},
function(results, callback){
//at this point, you will have all the results, you can send them back to millicore
return callback();
}
], function(err){
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment