QI を使用すると、次の新しいプロミスを定義できます。
var queue = q();
しかし、Bluebird を使用すると、次のようになります。
var queue = new Promise();
私は得る:
TypeError: the promise constructor requires a resolver function
Q と同じ結果を得るにはどうすればよいですか?
これは私のコードのスニペットです:
var queue = q()
promises = [];
queue = queue.then(function () {
return Main.gitControl.gitAdd(fileObj.filename, updateIndex);
});
// Here more promises are added to queue in the same way used above...
promises.push(queue);
return Promise.all(promises).then(function () {
// ...
});