SHARE
TWEET

Untitled

a guest Mar 20th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.   Lets say we have a dependancy map that looks like this -
  3.   a -
  4.   b - a
  5.   c - b
  6.   d - a,c
  7.   e - b
  8.   f - b,c
  9.   g - d
  10.   h - d,f
  11.   i - g,
  12.   j - g
  13.  
  14.   the corresponding Async map would look like this -
  15. */
  16.  
  17.  
  18.  
  19.  
  20. async.auto({
  21.     a:function(callback){},
  22.     b:["a",function(results,callback){}],
  23.     c:["b"function(results,callback){}],
  24.     d:["a","c",function(results,callback){}],
  25.     e:["b",function(results,callback){}],
  26.     f:["b","c"function(results,callback){}],
  27.     g:["d",function(results,callback){}],
  28.     h:["d","f",function(results,callback){}],
  29.     i:["g",function(results,callback){}],
  30.     j:["g",function(results,callback){}],
  31. },function(err,results){
  32.     // all done
  33. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top