-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Request] promise support #1806
Comments
This library pre-dates promises in JS, so thats the reason why those are not yet supported. I am open to discuss how a promise integration could look like though. |
hopefully it shouldn't be too hard, switching out the "pending" handler with a promise handler is basically what needs to be done. I can get cracking on a pull request. |
I would be ok to only support ES6 promises. The change needs to be backwards compatible though. |
@happyDemon were you able to implement something? I'd like to help if possible |
This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. |
Subject of the issue
I'm writing an image dimension validation rule (for which I have to wait for the image to load in order to be able to check its width & height). Normally I'd make a promise and return that while the image is being loaded. Once the image is loaded it would be easy to resolve or reject the promise based on the defined dimension restrictions.
I thought the remote rule would be the same (since out of the box it returns a promise). but it only seems to return 'pending'.
is there an easy way for me actually implement this rule? or is a promise-based return value on the schedule?
I have implemented this in parsleyJS which was able to take a promise as a return, so I'm kind of confused why it's not possible here.
Your environment
n/a
Steps to reproduce
n/a
Expected behaviour
n/a
Actual behaviour
n/a
The text was updated successfully, but these errors were encountered: