From db415c3558bca490eb0265587cf51e57b3d324c8 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Thu, 19 Nov 2020 08:30:41 +0100 Subject: [PATCH] Minor formatting, fix missing argument in an example --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d30346b..b799a22 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,10 @@ import { asyncForEachStrict } from '@wojtekmaj/async-array-utils'; const indexes = []; await asyncForEachStrict( [1, 2, 3], - async (el) => { indexes.push(index); console.log(el * 2); } + async (el, index) => { + indexes.push(index); + console.log(el * 2); + }, ); // undefined; 3 console.logs console.log(indexes); // [0, 1, 2] ``` @@ -94,7 +97,13 @@ Like `asyncMap()`, but runs iterations non-concurrently. import { asyncMapStrict } from '@wojtekmaj/async-array-utils'; const indexes = []; -await asyncMapStrict([1, 2, 3], async (el, index) => { indexes.push(index); return el * 2; }); // [2, 4, 6] +await asyncMapStrict( + [1, 2, 3], + async (el, index) => { + indexes.push(index); + return el * 2; + }, +); // [2, 4, 6] console.log(indexes); // [0, 1, 2] ``` -- 2.51.2