apr-series

3.0.3 • Public • Published

series

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

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

/apr-series/

    Package Sidebar

    Install

    npm i apr-series

    Weekly Downloads

    1

    Version

    3.0.3

    License

    MIT

    Last publish

    Collaborators

    • ramitos