> And there's just about never a reason to use the `Promise` constructor in real world code
Why not? If I want to wrap a callback function in a promised sequence, I don't see a way around it. Please don't suggest importing bluebird/promisifyAll because that only teaches me how to avoid thinking about the problem, not how it's actually solved, let alone why it's a problem to begin with.
function promiseMeFoo() {
return new Promise((resolve, reject) => {
asynchronousFoo((err, out) => {
if (err) return reject(err);
return resolve(out)
});
});
}
^ aside from just rearranging the code for legibility, how can I do the same thing without constructing a promise explicitly?