reduce) can be combined together to implement a few async control flow patterns. Continue reading
- Flatten the Promise chain whenever possible
- Straighten multiple nested promises with q.all() and q.spread()
- Don’t break the Promise chain. Make sure that the last promise is returned to the caller.
- Don’t overuse deferreds. Use them to promisify callback functions. In case a function returns a promise, it’s just better to form a chain with that same promise.