I have eg: 20 (can be dynamic) promises which makes API call. I am dividing into batches of 10. like [[p1,... p10], [p11,... p20] ...]
I am having for loop on it and executing p1 to p10 promises using promise.all like that then p11 to p20 etc..
let res: any = [];
batch.forEach(item => {
Promise.all(item).then(values => {
res = [...res, ...values];
});
})
Now Here I want to add delay between p1..p10 to p11..p20. What is the way for this in Javascript ?