p-chain
A simple function that turns an array of functions into sequentially executed promises. Usage is just as in the test:
function testFunc(num) {
return function() { return num; };
}
pChain([testFunc(1), testFunc(2), testFunc(3)]).then(function(result) {
if (!eq(3, result)) {
throw new Error("third promised function didn't fire as expected");
}
});
Available as npm install p-chain
.