p-chain

1.0.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i p-chain

Weekly Downloads

0

Version

1.0.1

License

MPL-2.0

Last publish

Collaborators

  • cormorant