Skip to main content

Function: applyPatches()

function applyPatches(
node,
patches,
reverse?
): void;

Applies the given patches to the given target object. Automatic type checking validates the completed batch, including nested lists. A batch that throws or is rejected is rolled back with compensating patches. Errors thrown by listeners do not roll it back.

Parameters​

ParameterTypeDefault valueDescription
nodeobjectundefinedTarget object.
patches| readonly Patch[] | readonly readonly Patch[][]undefinedList of patches to apply.
reversebooleanfalseWhether patches are applied in reverse order.

Returns​

void