Firebase Storage - Wait till all upload tasks are completed before executing function
问题 I'm using the following code to upload one or multiple files to Firebase Storage. When the upload is completed the downloadURL is logged in the console. I would like to execute another function when all the files are uploaded, outside the forEach function. How can I print the console log when all the uploads tasks are completed? onSubmit = e => { e.preventDefault(); const { files } = this.state; files.forEach(file => { const uploadTask = Storage.ref(`files/${file.name}`).put(file); uploadTask