Skip to content

pollen-solutions/js-selectors-mutation-observer

Repository files navigation

Selectors Mutation Observer

Latest Stable Version MIT Licensed

Installation

npm i @pollen-solutions/selectors-mutation-observer

Usage

Observe on a specific ancestor element (recommended)

import {SelectorsMutationObserver} from "@pollen-solutions/selectors-mutation-observer"

SelectorsMutationObserver('.element', function ($el, mutationObserverInstance) {
  console.log('HTMLElement with class [.element] was added !!')
}, document.querySelector('ancestor-of-element'))

Observe over the entire DOM (resource consumer)

import {SelectorsMutationObserver} from "@pollen-solutions/selectors-mutation-observer"

SelectorsMutationObserver('.element', function ($el, mutationObserverInstance) {
  console.log('HTMLElement with class [.element] was added !!')
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published