Hacker News new | past | comments | ask | show | jobs | submit login

You can still pass in callbacks to them. So if I got the parent's intent right, you've got:

  function bunchOfAsyncThings(callback) {
    var function1, function2;
  
    function1 = function (callback) {
      // do stuff here, then do callback
      function2(callback);
    };
    
    function 2 = function (callback) {
      // done with everything
      callback();
    };
   
    function1(callback);
  }
(Edit: formatting)



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: