a small wrapper for the MutationObserver which takes selector filters and emits events for insertions and removals
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
component.json
example.html
index.js

Readme.md

mutant

a simple api for the MutationObserver

Installation

Install with component(1):

$ component install bmcmahen/mutant

API

var editable = document.getElementById('editable');
var mutant = require('mutant')(editable, 'p');

mutant.on('added', function(el){
  console.log('added', el);
});

mutant.on('removed', function(el){
  console.log('removed', el);
});

mutant.disconnect();

License

MIT