Waiting For Multiple Events Using Promise.all – Part 2, Using ES6 Promises

Following up on my earlier example using bluebird’s promise library to wait for multiple events, I thought I’d try my hand at doing the same thing using ES6 Promises. This example uses ES6 promises. As I worked on it I realized to realize that the bluebird’s Promisify function could simply be replaced with a function (constructor) call to create a promise (see the function fakeAjaxWrapper in the JavaScript). So though it was not as convenient as Promisify in some ways, in the end the implementation was simpler, since I didn’t need an intermediate, node-style function to pass to Promisify.

See the Pen Promise.all Example – ES6 Version by John Lockwood (@JohnLockwood) on CodePen.

One thought on “Waiting For Multiple Events Using Promise.all – Part 2, Using ES6 Promises

Leave a Reply