Skip to content

createNestedAttributeUpdater

createNestedAttributeUpdater<T>(attributes, setAttributes, validate, onValidationError?): (path, value) => boolean

Defined in: wp-typia-block-runtime/src/validation.ts:377

Create a nested attribute updater that validates dotted-path updates.

T extends object

T

Current attribute snapshot.

(attrs) => void

Setter used to apply validated patches.

(value) => ValidationResult<T>

Validator used to check the next attribute state.

(result, path) => void

Optional callback for rejected nested updates.

A path-based updater that returns true when the patch is accepted.

(path, value) => boolean

const updatePath = createNestedAttributeUpdater(attributes, setAttributes, validate);