Skip to main content

Function: onPatches()

function onPatches(subtreeRoot, listener): OnPatchesDisposer;

Adds a listener that will be called every time a patch is generated for the tree of the given target object.

The listener runs inside the action that made the change, so getCurrentActionContext() returns that action's context: its rootContext is the top-level action (for a flow step, the flow).

Parameters​

ParameterTypeDescription
subtreeRootobjectSubtree root object of the patch listener.
listenerOnPatchesListenerThe listener function that will be called everytime a patch is generated for the object or its children.

Returns​

OnPatchesDisposer

A disposer to stop listening to patches.