@nicer-toolbox/async-for-each

1.0.4 • Public • Published

Nicer Toolbox

asyncForEach

Allows await inside of a foreach loop.

// For Node
const asyncForEach = require("@nicer-toolbox/async-for-each");
// For React
import asyncForEach from "@nicer-toolbox/async-for-each";

// Basic Usage
asyncForEach(arrayOfItems, callBackFunction);

// Example
const contacts = ["zzsvrqyalq", "fz12nawb3g", "ugfqduns16", "0bulps6hrb"];

asyncForEach(contacts, async (id) => {
  return await getUserData(id);
});

Readme

Keywords

Package Sidebar

Install

npm i @nicer-toolbox/async-for-each

Weekly Downloads

94

Version

1.0.4

License

ISC

Unpacked Size

1.05 kB

Total Files

3

Last publish

Collaborators

  • maks112v