Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different promise implementations are not accepted #23

Open
jrvidal opened this issue Jun 11, 2014 · 1 comment
Open

Different promise implementations are not accepted #23

jrvidal opened this issue Jun 11, 2014 · 1 comment

Comments

@jrvidal
Copy link

jrvidal commented Jun 11, 2014

If I try to do something like:

res.send(query.exec().then(function(data) {
    var formattedData = format(data);
    return data;
}));

the plugin does not work, since it is checking for the mongoose promise implementation in particular, and the then method returns a MPromise. It would be nice to be able to interoperate with thenables in general or, at least, to redefine mongoose.Promise#then to return mongoose.Promise instances.

@aheckmann
Copy link
Contributor

instead of using instanceof checks for Promises we could add an isPromise() function which accepts an arg and checks if 'function' == typeof arg.then. pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants