Skip to main content

AsyncValidatorState

Non-validation state available through the validated node API.

Import

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

When to use it

Use for the state contract available through validator node APIs. Its declaration intentionally avoids recursively depending on the validation state being computed.

Declaration

type AsyncValidatorState = {
readonly submitting: Signal<boolean>;
readonly touched: Signal<boolean>;
readonly untouched: Signal<boolean>;
readonly dirty: Signal<boolean>;
readonly pristine: Signal<boolean>;
readonly disabled: Signal<boolean>;
readonly disabledReasons: Signal<readonly DisabledReason[]>;
readonly enabled: Signal<boolean>;
readonly readonly: Signal<boolean>;
readonly writable: Signal<boolean>;
readonly hidden: Signal<boolean>;
readonly visible: Signal<boolean>;
readonly required: Signal<boolean>;
};

Declared members

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

MemberMeaning
submittingWhether this node or an ancestor form is currently running its submission action.
touchedWhether this node has been marked as interacted with.
untouchedLogical inverse of touched(); true until this node is marked as touched.
dirtyWhether user interaction or markAsDirty() has recorded this node as modified.
pristineLogical inverse of dirty(); true while the node does not report user modification.
disabledWhether local or inherited disabled state suppresses this node's own validation. The node value remains present in its parent aggregate.
disabledReasonsActive reasons that currently make this node disabled.
enabledLogical inverse of disabled(); true while the node participates normally.
readonlyWhether consumers should prevent the user from editing this node.
writableLogical inverse of readonly(); true while the node may be edited.
hiddenWhether consumers should omit this node from the visible UI.
visibleLogical inverse of hidden(); true while the node should be displayed.
requiredWhether the current validation rules require this node to contain a value.