Skip to main content

AsyncValidatorContext

Reactive node context and cancellation signal provided to an asynchronous validator run.

Import​

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

When to use it​

Use for an asynchronous validation callback. Observe abortSignal and return a supported async result; do not publish stale work after cancellation.

Declaration​

type AsyncValidatorContext<TValue, TApi extends ValidatorReadonlyApi<TValue> = AsyncValidatorApi<TValue>, TField extends AnyNode = ValidatorNode> = AsyncValidatorBaseContext<TValue, TApi, TField> & {
readonly abortSignal: AbortSignal;
};

Type parameters​

ParameterConstraintDefault
TValueUnconstrainedRequired
TApiValidatorReadonlyApi<TValue>AsyncValidatorApi<TValue>
TFieldAnyNodeValidatorNode

Declared members​

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

MemberMeaning
abortSignalCancellation signal for this execution.