Runs a callback everytime a new node is attached to a given node.
The callback can optionally return a disposer which will be run when the child is detached.
Param: target
Function that returns the node whose children should be tracked.
Param: childNodeType
The node type (or array of types) for which it should be invoked, or undefined if it should be invoked for them all.
Param: onChildAttached
Callback called when a child is attached to the target node.
Param: deep
(default: false) Whether to run the callback for all children deeply or only for shallow children.
Param: fireForCurrentChildren
(default: true) Whether to immediately call the callback for already attached children.
Returns
A disposer function. Pass true to run the detach disposers for children that had the attach event fired.
Runs a callback everytime a new node is attached to a given node. The callback can optionally return a disposer which will be run when the child is detached.
Param: target
Function that returns the node whose children should be tracked.
Param: childNodeType
The node type (or array of types) for which it should be invoked, or undefined if it should be invoked for them all.
Param: onChildAttached
Callback called when a child is attached to the target node.
Param: deep
(default:
false
) Whether to run the callback for all children deeply or only for shallow children.Param: fireForCurrentChildren
(default:
true
) Whether to immediately call the callback for already attached children.Returns
A disposer function. Pass
true
to run the detach disposers for children that had the attach event fired.