UNPKG

@momentum-ui/react-collaboration

Version:

Cisco Momentum UI Framework for React Collaboration Applications

14 lines (13 loc) 606 B
/** * This custom hooks abstracts the usage of the Mutation Observer with React components. * Watch for changes being made to the DOM tree and trigger a custom callback. * * Note: with debounce the intermediate MutationRecords will be lost * * @param targetEl Observed DOM element * @param callback Mutation callback * @param config Mutation Observer config and other config * * @link https://blog.logrocket.com/guide-to-custom-react-hooks-with-mutationobserver/ */ export declare const useMutationObservable: (targetEl: Node, callback: MutationCallback, config?: MutationObserverInit) => void;