Resolving Async Validation
Because validate
returns synchronously, your application must recognize when async validation needs to be resolved. The validation result returned from validate
will only include the validateAsync
property when a async validation needs to be resolved. If the validateAsync
result property exists, it will be a function
that returns a Promise
.
Async Validation Helper: validateAsync
validateAsync
To avoid boilerplate code, Strickland provides a validateAsync
function as a named export. This function always returns a Promise
, regardless of whether validation completed synchronously or needs to be resolved asynchronously.
Last updated