1.0.1 • Published 7 years ago

p-chain v1.0.1

Weekly downloads
4
License
MPL-2.0
Repository
github
Last release
7 years ago

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.