mpromise
mpromise copied to clipboard
Fix LearnBoost/mongoose#2308: add .catch()
Is there any way we can "monkey patch" this in our apps while this isn't merged and released?
Please merge this ASAP. :cry:
You can do a really gnarly hack:
require('mongoose/node_modules/mpromise').prototype.catch = function (onReject) {
return this.then(undefined, onReject);
};
But of course you'd have to maintain that code yourself. On the other hand, catch()
is a trivial wrapper around then()
anyway, so not a big deal :)
please merge +1 this helps monk, too
Still waiting on this, but with LearnBoost/mongoose#2688 this will be a non-issue. I'm strongly considering deprecating mongoose's 'mpromise by default' practice.
:+1:
+1
@aheckmann merge PR, please
@aheckmann Are u going to merge this?
@vkarpov15 I recommend yaku as a replacement.
See Automattic/mongoose#2688 - mongoose is gonna switch to a BYOP approach
@vkarpov15 I'd be happy to merge, but I need some more test cases.
mongoose is gonna be moving away from mpromise, and the latest release supports "bring your own promises", so this is not a priority. If you won't merge this PR as is, feel free to close it.