apr-series
v3.0.3
Published
Run the functions in the tasks in series, each one running once the previous function has completed.
Downloads
16
Maintainers
Readme
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