Skip to content

Instantly share code, notes, and snippets.

@sebby
Last active August 29, 2015 13:55
Show Gist options
  • Select an option

  • Save sebby/8751698 to your computer and use it in GitHub Desktop.

Select an option

Save sebby/8751698 to your computer and use it in GitHub Desktop.
Exemple d'utilisation de la lib Async (browser)
async.parallel([
function(callback){
setTimeout(function(){
console.log('flag1');
callback(null,{"flag1":new Date()});
}, 2000);
},
function(callback){
setTimeout(function(){
console.log('flag2');
callback(null, {"flag2":new Date()});
}, 1000);
}
],
function(err, results){
console.log('terminé');
console.log(results);
for(data in results){
console.log(results[data]);
}
});
@tugbaer

tugbaer commented Feb 1, 2014

Copy link
Copy Markdown

{
console.log(results[data]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment