Skip to main content

ParameterizedAsyncValidatorOptions

Options for an async validator whose tracked dependencies are exposed as a typed snapshot.

Import

import type { ParameterizedAsyncValidatorOptions } from '@ngblocks/form-nodes';

When to use it

Use for async options that also derive tracked params. The execution function belongs to ParameterizedAsyncValidatorConfig.

Declaration

type ParameterizedAsyncValidatorOptions<TValue, TParams, TApi extends ValidatorReadonlyApi<TValue> = AsyncValidatorApi<TValue>, TField extends AnyNode = ValidatorNode> = AsyncValidatorOptions<TValue, TApi, TField> & {
params: (context: AsyncValidatorBaseContext<TValue, TApi, TField>) => TParams;
};

Type parameters

ParameterConstraintDefault
TValueUnconstrainedRequired
TParamsUnconstrainedRequired
TApiValidatorReadonlyApi<TValue>AsyncValidatorApi<TValue>
TFieldAnyNodeValidatorNode

Declared members

The declaration above also includes inherited contracts and overloads where applicable.

MemberMeaning
paramsDerives the dependency snapshot passed to validate. Signals read here are tracked. Objects and arrays are compared shallowly, so an unchanged first-level snapshot does not restart validation even if a source signal emits. Scalars use value equality.