JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 827
  • Score
    100M100P100Q104427F
  • License MIT

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

Package Exports

  • apr-parallel

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (apr-parallel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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