Closed cbraynor closed 4 years ago
n.b.
This can be dangerous: somePromise.then(resolve, reject); because resolve and reject change behaviour depending on whats passed them them. So what somepromise returns can affect how the task is resolved.
somePromise.then(function(){resolve()}, function(){reject()})
Another option would be to be able to pass a promise to the resolve() function. resolve(somePromise)
Instead of directly calling
resolve()
orreject()
you should be able to return a Promise from theprocessingFunction
- just like how mocha handles with/without adone
callback - this would avoid the awkwardreturn somePromise.then(resolve, reject);