I care just about performance. So just need to run nested promises in for loop. I do not care if one of promise fails.. So just want to execute it as quickly as possible. Not sure if I can do Promise.all. What if it's for loop for 1000 promises that return large data in fetch response? And will such architecture cause response data issue that will interfere with other promise responses?
let data = [//very large array ...]
for (let index = 0; index < data.length; index++) {
Promise1(data[i]).then(result => {
if (result) {
Promise2(result.data).then(result => {
if (resullt) {
// STORE DATA IN DB
}
}).catch(err => {
// do nothing
})
}
}).catch(err => {
// do nothing
})
}