2 ms·
It doesn't have the "pyramid of Doom" feeling of the "traditional NodeJS" version, but it does not make it easy to follow the flow. A better approach, IMHO, wou
by mercurial 14y ago
It doesn't have the "pyramid of Doom" feeling of the "traditional NodeJS" version, but it does not make it easy to follow the flow. A better approach, IMHO, would be to use a promise library like q [1]
1: https://github.com/kriskowal/q/ https://github.com/kriskowal/q/
- Offler 14y agoAuthor here: I like promises and I think they have their uses but I think for most cases simply writing well structured and encapsulated code will make them superfluous. You also have the problem of working with APIs that don't return promises.