With Q I can define a new promise with:
var queue = q();
But with Bluebird if I do:
var queue = new Promise();
I get:
TypeError: the promise constructor requires a resolver function
How can I get the same result that I had with Q?
This is a snippet of my code:
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 () {
// ...
});
See Question&Answers more detail:os