0.0.1 • Published 1 year ago

@pollen-solutions/selectors-mutation-observer v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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 !!')
})