javascript - Promises.all() tracking invidual tasks completion -


i'm using promise.all(tasks) track overall completion of tasks executed in no particular order (which main aim). want track individual tasks completion, how do that?

nothing keeps attaching individual handlers awaiting them together:

let tasks = …; ([t, i] of tasks.entries())     t.then(res => {         console.log("task "+i+" completed with", res);     }, err => {         console.log("task "+i+" failed because", err);     }); promise.all(tasks).then(all => {     console.log("all tasks completed"); }, err => {     console.log("something failed"); }); 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -