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

Bluebird promises bind not working properly #5343

Closed
LeonardoGentile opened this issue Nov 25, 2015 · 4 comments
Closed

Bluebird promises bind not working properly #5343

LeonardoGentile opened this issue Nov 25, 2015 · 4 comments

Comments

@LeonardoGentile
Copy link

If I use

User.findOne({email:data.email})
  .bind({})
  .then(function(user) {
   //...

Things won't work TypeError: Object [object Object] has no method 'bind'
But If i put the bind after the first then then things will work as expected

User.findOne({email:data.email})
  .then(function(user) {})
  .bind({}) 
  //...

Maybe the promise chain is wrapped as bluebird promise only after the first then?

@devinivy
Copy link

This is true. Currently only the most basic promise methods are supported. This was originally for ease marrying the existing User.find().exec(cb) ( also, .populate(), .where(), etc.) syntax with promise support, but I think we can deal with this more gracefully to support the full bluebird API. Would you like to make a PR to our roadmap file to put this in the queue?

@LeonardoGentile
Copy link
Author

@devinivy 👍 done

@devinivy
Copy link

Thanks!

@sailsbot
Copy link

Thanks for posting, @LeonardoGentile. I'm a repo bot-- nice to meet you!

It has been 30 days since there have been any updates or new comments on this page. If this issue has been resolved, feel free to disregard the rest of this message. On the other hand, if you are still waiting on a patch, please:

  • review our contribution guide to make sure this submission meets our criteria (only verified bugs with documented features, please; no questions, commentary, or bug reports about undocumented features or unofficial plugins)
  • create a new issue with the latest information, including updated version details with error messages, failing tests, and a link back to the original issue. This allows GitHub to automatically create a back-reference for future visitors arriving from search engines.

Thanks so much for your help!

@raqem raqem transferred this issue from balderdashy/waterline May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants