We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf6a451 commit 01e1f58Copy full SHA for 01e1f58
src/forEach.js
@@ -1,5 +1,7 @@
1
import asyncMap from './map';
2
3
-export default async function asyncForEach(arr, fn) {
4
- await asyncMap(arr, fn);
+export default function asyncForEachStrict(arr, fn) {
+ return new Promise((resolve) => {
5
+ asyncMap(arr, fn).then(() => resolve());
6
+ });
7
}
src/forEach_strict.js
import asyncMapStrict from './map_strict';
-export default async function asyncForEachStrict(arr, fn) {
- await asyncMapStrict(arr, fn);
+ asyncMapStrict(arr, fn).then(() => resolve());
0 commit comments