Skip to main content

FormPatch

Partial object accepted by a form's patch(); omitted properties remain unchanged, but supplied arrays require complete item values and reconcile like set().

Import

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

When to use it

Use to derive the patch value contract from the form's child or item node types. It describes accepted patch input rather than a complete node value. Use FormNodeValue<typeof node> when starting from an existing node instance.

Declaration

type FormPatch<TNodes extends Nodes> = {
[K in keyof TNodes]?: NodePatch<TNodes[K]>;
};

Type parameters

ParameterConstraintDefault
TNodesNodesRequired