tiny-dom-notifier

Get notified when a given DOM element is created or removed

tiny-dom-notifier

Get notified when a given DOM elements are created or removed. Works as a standalone script or with Browserify.

NPM

npm install tiny-dom-notifier --save

Bower

bower install tiny-dom-notifier --save

Browser

var notifier = window.tinyDomNotifier;
 
notifier('.some-element')
  .added(function (elements) {
    
  })
  .removed(function (elements) {
    
  });

Browserify

var notifier = require('tiny-dom-notifier');
 
notifier('.some-element')
  .added(function (elements) {
    
  })
  .removed(function (elements) {
    
  });
  • callback - the function to execute when a DOM element is added. The callbacked receives an array of the elements as the only argument
  • callback - the function to execute when a DOM element is removed. The callbacked receives an array of the elements as the only argument

Requires Phantomjs is installed

npm install
npm test
npm install
npm run build