AsyncValidator
Validator marked by asyncValidator() for asynchronous scheduling and cancellation.
Import
import type { AsyncValidator } from '@ngblocks/form-nodes';
When to use it
Use for the marked result of asyncValidator(). A plain function returning a Promise is not a substitute for configuring a validator through the helper.
Declaration
type AsyncValidator<TValue, TField extends AnyNode = AnyNode> = (context: ValidatorContext<TValue, ValidatorApi<TValue>, TField>) => ValidationResult;
Type parameters
| Parameter | Constraint | Default |
|---|---|---|
TValue | Unconstrained | Required |
TField | AnyNode | AnyNode |