FirebaseExtended / firebase-queue

MIT License
786 stars 108 forks source link

Should be able to return a Promise from the `processingFunction` #25

Closed cbraynor closed 4 years ago

cbraynor commented 9 years ago

Instead of directly calling resolve() or reject() you should be able to return a Promise from the processingFunction - just like how mocha handles with/without a done callback - this would avoid the awkward return somePromise.then(resolve, reject);

startswithaj commented 8 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)