Last active
August 29, 2015 13:55
-
-
Save sebby/8751698 to your computer and use it in GitHub Desktop.
Exemple d'utilisation de la lib Async (browser)
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
| 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]); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{
console.log(results[data]);