Skip to content

Commit db415c3

Browse files
committed
Minor formatting, fix missing argument in an example
1 parent b618879 commit db415c3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ import { asyncForEachStrict } from '@wojtekmaj/async-array-utils';
6565
const indexes = [];
6666
await asyncForEachStrict(
6767
[1, 2, 3],
68-
async (el) => { indexes.push(index); console.log(el * 2); }
68+
async (el, index) => {
69+
indexes.push(index);
70+
console.log(el * 2);
71+
},
6972
); // undefined; 3 console.logs
7073
console.log(indexes); // [0, 1, 2]
7174
```
@@ -94,7 +97,13 @@ Like `asyncMap()`, but runs iterations non-concurrently.
9497
import { asyncMapStrict } from '@wojtekmaj/async-array-utils';
9598

9699
const indexes = [];
97-
await asyncMapStrict([1, 2, 3], async (el, index) => { indexes.push(index); return el * 2; }); // [2, 4, 6]
100+
await asyncMapStrict(
101+
[1, 2, 3],
102+
async (el, index) => {
103+
indexes.push(index);
104+
return el * 2;
105+
},
106+
); // [2, 4, 6]
98107
console.log(indexes); // [0, 1, 2]
99108
```
100109

0 commit comments

Comments
 (0)