Waiting for Multiple Asynchronous Events Using Bluebird’s Promise.all

As part of taking Kyle Simpson’s Advanced JavaScript course (which I recommend highly, by the way), I chose the bluebird promise library to work through my solution to one of the exercises.  The exercise asked us to manage three simultaneous asynchronous calls, printing the results of each call in order at the end.  Bluebird’s Promise.all API was an easy solution to this — all that was needed was a little wrapper function to wrap the provided function into the Node-style format expected by Promise.all.

For an example of doing the same thing using ES6 Promises, check out Part 2 of this Article

Though the solution is embedded below, it’s not ideal to view here because opening the console will also mix in some WordPress-ey junk.  I should modify this pen to write to the DOM! 🙂

One thought on “Waiting for Multiple Asynchronous Events Using Bluebird’s Promise.all

Leave a Reply