3.0.3 • Published 6 years ago

apr-waterfall v3.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

waterfall

Runs the tasks array of functions in series, each passing their results to the next in the array.

npm.io npm.io

Parameters

Examples

import waterfall from 'apr-waterfall';

const then = (v) => new Promise((resolve) => resolve(v));

const output = await waterfall([
  async () => await then(1),
  async (v) => await then(v + 2),
  async (v) => await then(v + 3)
]);

// output = 6

Returns Promise