@pollen-solutions/selectors-mutation-observer
v0.0.1
Published
Pollen Solutions - JS - Selectors Mutation Observer
Downloads
6
Maintainers
Readme
Selectors Mutation Observer
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 !!')
})