Skip to content
Snippets Groups Projects
Commit cf599643 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Did async foreach refactoring

parent 743d9bc0
No related branches found
No related tags found
No related merge requests found
......@@ -108,12 +108,6 @@ class VPUFileUpload extends VPULitElement {
fileElem.value = '';
}
async asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
async handleFiles(files) {
console.log('handleFiles: files.length = ' + files.length);
......@@ -121,7 +115,7 @@ class VPUFileUpload extends VPULitElement {
{ "detail": {}, bubbles: true, composed: true }));
// we need to wait for each upload until we start the next one
await this.asyncForEach(files, async (file) => this.uploadFile(file));
await commonUtils.asyncArrayForEach(files, async (file) => this.uploadFile(file));
this.dispatchEvent(new CustomEvent("vpu-fileupload-all-finished",
{ "detail": {}, bubbles: true, composed: true }));
......
common @ 4f1d5c50
Subproject commit 5aa64ec47e7b65d69327f4dec1102917fe33bd22
Subproject commit 4f1d5c504ad5935b8903ab37abcbaa2b588112bd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment