Skip to content

Commit 91ef8d1

Browse files
committed
Minor tweak
1 parent 82b8cdc commit 91ef8d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ export function pMapIterable(
212212
return;
213213
}
214214

215+
pendingPromisesCount++;
216+
215217
const promise = (async () => {
216-
pendingPromisesCount++;
217218
const {done, value} = await iterator.next();
218219

219220
if (done) {
@@ -242,6 +243,7 @@ export function pMapIterable(
242243

243244
return {done: false, value: returnValue};
244245
} catch (error) {
246+
pendingPromisesCount--;
245247
isDone = true;
246248
return {error};
247249
}

0 commit comments

Comments
 (0)