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.
Type Parameters
Section titled “Type Parameters”T extends object
Parameters
Section titled “Parameters”attributes
Section titled “attributes”T
Current attribute snapshot.
setAttributes
Section titled “setAttributes”(attrs) => void
Setter used to apply validated patches.
validate
Section titled “validate”(value) => ValidationResult<T>
Validator used to check the next attribute state.
onValidationError?
Section titled “onValidationError?”(result, path) => void
Optional callback for rejected nested updates.
Returns
Section titled “Returns”A path-based updater that returns true when the patch is accepted.
(path, value) => boolean
Example
Section titled “Example”const updatePath = createNestedAttributeUpdater(attributes, setAttributes, validate);