You can tell to use any A compatible promise implemention like this: There are already many validation libraries out there today but most of them are very tightly coupled to a language or framework.The goal of is to provide a cross framework and cross language way of validating data.If an is thrown from an async validator the argument passed to the rejection handler will be that error.This allows you to differentiate from coding errors and validation errors.This differs from example Ruby on Rails where validators instead have the option.I find it quite common that you want to have constraints on an optional attribute.
It is unit tested with 100% code coverage and can be considered fit for production.
If the attributes objects is an HTML/DOM/j Query element Even though none of the built in validators are async it is sometimes useful to have async validations.
One example would be to check if a username is already used by asking the server.
Unless otherwise specified you can always specify the message option to customize the message returned if the validator doesn't pass.
Just remember to not include the attribute name since it's automatically prepended to the error message.