1putStorageItem(item) {
2 // the return value will be a Promise
3 return firebase.storage().ref("YourPath").put("YourFile")
4 .then((snapshot) => {
5 console.log('One success:', item)
6 }).catch((error) => {
7 console.log('One failed:', item, error.message)
8 });
9}
10
1Promise.all(
2 // Array of "Promises"
3 myItems.map(item => putStorageItem(item))
4)
5.then((url) => {
6 console.log(`All success`)
7})
8.catch((error) => {
9 console.log(`Some failed: `, error.message)
10});
11