3.0.3 • Published 6 years ago

apr-series v3.0.3

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

series

Run the functions in the tasks in series, each one running once the previous function has completed.

npm.io npm.io

Parameters

Examples

import series from 'apr-series';

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

const withArray = await series([
  async () => await then(1),
  async () => await then(2)
]);

// withArray = [1, 2]

const withObject = await series({
  one: async () => await then(1),
  two: async () => await then(2)
});

// withObject = { one: 1, two: 2 }

Returns Promise