mobx-bonsai
    Preparing search index...

    Function onChildAttachedTo

    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.

    Function that returns the node whose children should be tracked.

    The node type (or array of types) for which it should be invoked, or undefined if it should be invoked for them all.

    Callback called when a child is attached to the target node.

    (default: false) Whether to run the callback for all children deeply or only for shallow children.

    (default: true) Whether to immediately call the callback for already attached children.

    A disposer function. Pass true to run the detach disposers for children that had the attach event fired.

    • Type Parameters

      Parameters

      Returns OnChildAttachedToDisposer

    • Type Parameters

      Parameters

      Returns OnChildAttachedToDisposer

    • Type Parameters

      • T extends object = object

      Parameters

      • params: OnChildAttachedToParams<undefined, T>

      Returns OnChildAttachedToDisposer