Remove try catch from provided functions, user handles errors

This commit is contained in:
Jerry Kurian
2019-09-12 09:41:04 -04:00
parent 586f618e95
commit 517e281ce5
11 changed files with 26 additions and 74 deletions

View File

@@ -20,14 +20,9 @@ export function parallelMap<T, R>(
}
inflight += 1;
callback();
try {
const res = await mapper(data);
this.push(res);
} catch (e) {
this.emit(e);
} finally {
inflight -= 1;
}
const res = await mapper(data);
this.push(res);
inflight -= 1;
},
async flush(callback) {
while (inflight > 0) {