• A hook that creates a MutationObserver and observes a DOM element for mutations. When a mutation occurs, the callback function is executed.

    Type Parameters

    • T extends Node

    Parameters

    • targetEl: T

      The DOM element to observe

    • cb: MutationCallback

      The callback function to execute when a mutation occurs

    • options: MutationObserverOptions = DEFAULT_OPTIONS

      Options to pass to the MutationObserver to configure what mutations to observe

    Returns void