News for hackers. Stuff that matters.
Re:Are you serial, Promise.all? by nostrademons on Friday March 04, 2016 @05:11PM (#11227214)
The canonical way to execute a collection of promises serially is through Array.prototype.reduce:

  let finalResult = promises.reduce((current, next) => current.then(next), Promise.resolve());
(I've used ES6 syntax, but you can do this in ES5.1 as well. You can also substitute Promise.prototype.then.call for the arrow function.)

The beauty of this one-liner is that it works with any promise-like object: you don't need to use BlueBird, you don't even need to use a uniform promise implementation, it'll work with anything that follows the Promises/A+ spec.

Re:Are you serial, Promise.all? by jadengore on Friday March 04, 2016 @05:44PM (#11227362)
This is cool! Thanks for sharing!

In my case, there is a bit less code, but I really do appreciate how your implementation is not Bluebird-dependent.