I have two tasks ran by Bluebird:
// Require bluebird...
var Promise = require("bluebird");
// Run two tasks together
Promise
.all([Git.getRemotes(), GitFtp.getFtpRemotes()])
.spread(function (remotes, ftpRemotes) {
// Something cool
});
With q.js I had as response:
remotes.value (the response of my task)
remotes.state ("fullfilled" or "rejected" depending if the task thrown an error or not)
ftpRemotes.value
ftpRemotes.state
So inside the spread()
part I was able to check the state of each task.
This is the code I was using before Bluebird
With bluebird I get just:
remotes
ftpRemotes
Containing just the array generated by my tasks.
I think I need Promise.allSettled
but I can't find it in the documentation.
How can I get the state of each task?