Skip to content

Instantly share code, notes, and snippets.

@handlename
Created November 12, 2011 05:59
Show Gist options
  • Save handlename/1360120 to your computer and use it in GitHub Desktop.
Save handlename/1360120 to your computer and use it in GitHub Desktop.
var next = require("path/to/next");
function first(callbacks, params) {
asyncProcess(function(res) {
params.first = res;
next(callbacks, params);
});
}
function second(callbacks, params) {
asyncProcess(function(res) {
params.second = res;
next(callbacks, params);
});
}
function third(callbacks, params) {
asyncProcess(function(res) {
params.third = res;
next(callbacks, params);
});
}
function last(callbacks, params) {
asyncProcess(function(res) {
console.log(params);
next(callbacks, params);
});
}
next(
[first, second, third, last],
{ first: null, second: null, third: null }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment