Async validation run twice
See original GitHub issueI call both .passes() and .fails() to check the async validation. Right now I don’t find any solution to check both validation states without calling both of them. This runs the validation twice.
I think we need a method which runs the async function only one time and calls respectively passes/fails callbacks. Or at least a promise implementation (as I proposed in this issue: https://github.com/skaterdav85/validatorjs/issues/127)
For example a possible solution could be to provide a validation function which accept an object with the two callbacks:
validator.validate({
passes: () => {},
fails: () => {},
});
We discussed the problem in this issue: https://github.com/foxhound87/mobx-react-form/issues/214
Thank You.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Async validation run twice · Issue #155 · mikeerickson/validatorjs
I call both .passes() and .fails() to check the async validation. Right now I don't find any solution to check both validation states ......
Read more >Form - Async validation is being called multiple times
if the form is valid, we are making server-side call to save the form, which is again causing async validator to be called...
Read more >Async validation is triggered multiple times on form.setValues()
You patchData() in setValue() -> the validator is triggered again. I'm guessing Angular internally uses switchMap for the validation Observable, ...
Read more >Validation — tapir 1.x documentation - SoftwareMill
The validators are run when a value is being decoded from its low-level representation. This is done using the Codec.decode method, which returns...
Read more >Validation Chain API - express-validator
Runs the current validation chain in an imperative way. app.post('/create-user', async (req, res, next) => { await ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@foxhound87 Can you write a real example here? I have this issue and can’t figure out how to resolve.
@raghavgarg1257 take a look at this commit:
https://github.com/foxhound87/mobx-react-form/commit/b74be11f3d16af53870a55a9e5a26654dbff4b36