AsyncValidatorOptions
interface
Options that indicate how to create a resource for async validation for a field, and map its result to validation errors.
API
interface AsyncValidatorOptions<TValue, TParams, TResult, TPathKind extends PathKind = PathKind.Root> {}
params
(ctx: FieldContext<TValue, TPathKind>) => TParams
A function that receives the field context and returns the params for the resource.
factory
(params: Signal<TParams | undefined>) => ResourceRef<TResult | undefined>
A function that receives the resource params and returns a resource of the given params.
The given params should be used as is to create the resource.
The forms system will report the params as undefined
when this validation doesn't need to be run.
errors
MapToErrorsFn<TValue, TResult, TPathKind>
A function that takes the resource result, and the current field context and maps it to a list of validation errors.
Jump to details