1. apr-parallel
Run the tasks collection of functions in parallel, without waiting until the previous function has completed.
apr-parallel
Package: apr-parallel
Created by: ramitos
Last modified: Mon, 13 Jun 2022 03:19:56 GMT
Version: 3.0.3
License: MIT
Downloads: 1,710
Repository: https://github.com/ramitos/apr

Install

npm install apr-parallel
yarn add apr-parallel

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

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code