tiny-dom-notifier

0.1.3 • Public • Published

tiny-dom-notifier

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

browser support

Install

NPM

npm install tiny-dom-notifier --save

Bower

bower install tiny-dom-notifier --save

Usage

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) {
    
  });

Methods

added(callback)

  • callback - the function to execute when a DOM element is added. The callbacked receives an array of the elements as the only argument

removed(callback)

  • callback - the function to execute when a DOM element is removed. The callbacked receives an array of the elements as the only argument

Run Tests

Requires Phantomjs is installed

npm install
npm test

Build

npm install
npm run build

Readme

Keywords

none

Package Sidebar

Install

npm i tiny-dom-notifier

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • scottcorgan