Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

apr-parallel

ramitos3.7kMIT3.0.3

Run the tasks collection of functions in parallel, without waiting until the previous function has completed.

parallel, async, await, promise, control, flow, control-flow, awaitful, promises, async-await, es2015, es2016, es2017, es6, es7, es8

readme

parallel

Run the tasks collection of functions in parallel, without waiting until the previous function has completed.

Parameters

Examples

import parallel from 'apr-parallel';

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

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

// withArray = [1, 2]

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

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

Returns Promise