lib/js/utils.js
function seqActions(actions, seed, onCompleted) {
  var index = 0;

  function invokeNext(v) {
    var action = actions[index];
    action(v, function (res) {
      index = index + 1;
      if (index < actions.length) {
        invokeNext(res);
      } else {
        onCompleted(res);
      }
    });
  }

  invokeNext(seed);
}
function seqActions(actions, seed, onCompleted) {
  var index = 0;

  function invokeNext(v) {
    var action = actions[index];
    action(v, function (res) {
      index = index + 1;
      if (index < actions.length) {
        invokeNext(res);
      } else {
        onCompleted(res);
      }
    });
  }

  invokeNext(seed);
}
function seqActions ( actions , seed , onCompleted ) { var index = 0 ; function invokeNext ( v ) { var action = actions [ index ] ; action ( v , function ( res ) { index = index + 1 ; if ( index < actions . length ) { invokeNext ( res ) ; } else { onCompleted ( res ) ; } } ) ; } invokeNext ( seed ) ; }
chain a sequence of asynchronous actions
chain a sequence of asynchronous actions