Bluebird missing docs
Promise Concepts
2 anti patterns not to fall in
then((success) => { }, error=> { })
## Useful bluebird function
* **Promise.all**
- Params: Array of promise
- Process in parallel
- Reject early if an error occur
- the return value is an array of each promises return in the order they were define
* **Promise.each**
Same than promise.all but
- Process in sequence
* **Promise.join**
It is recommended to use Promise.join instead or Promise.all
when the action to do are fixed in advance and not numerous.
In this case only 3 promises that we know in advance.
```js
var Promise = require("bluebird");
var join = Promise.join;
join(getPictures(), getComments(), getTweets(),
function(pictures, comments, tweets) {
console.log("in total: " + pictures.length + comments.length + tweets.length);
});Last updated