Answers for "firebase javascript up;oad multiple files"

0

firebase javascript up;oad multiple files

Promise.all(
  // Array of "Promises"
  myItems.map(item => putStorageItem(item))
)
.then((url) => {
  console.log(`All success`)
})
.catch((error) => {
  console.log(`Some failed: `, error.message)
});
Posted by: Guest on March-11-2021
0

firebase javascript up;oad multiple files

putStorageItem(item) {
  // the return value will be a Promise
  return firebase.storage().ref("YourPath").put("YourFile")
  .then((snapshot) => {
    console.log('One success:', item)
  }).catch((error) => {
    console.log('One failed:', item, error.message)
  });
}
Posted by: Guest on March-11-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language