Skip to content

Instantly share code, notes, and snippets.

@7fe
Forked from Raynos/Async_After.js
Created July 30, 2011 15:44
Flow control utility for node.js
var after = function _after(count, f) {
var c = 0, results = [];
return function _callback() {
results.push( arguments.length > 1 ? arguments : arguments[0] );
if (++c === count) {
f.apply(this, results);
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment