Bluebird によって実行される 2 つのタスクがあります。
// Require bluebird...
var Promise = require("bluebird");
// Run two tasks together
Promise
.all([Git.getRemotes(), GitFtp.getFtpRemotes()])
.spread(function (remotes, ftpRemotes) {
// Something cool
});
q.jsを使用すると、次のような応答がありました。
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
ということで、spread()
パーツ内で各タスクの状態を確認することができました。
これはBluebirdの前に使用していたコードです
ブルーバードを使用すると、次のようになります。
remotes
ftpRemotes
私のタスクによって生成された配列だけを含みます。
必要だと思いますPromise.allSettled
が、ドキュメントで見つけることができません。
各タスクの状態を取得するにはどうすればよいですか?