fromMutationObserver
Arguments
Returns
Example
var foo = document.getElementById('foo');
var obs = Rx.DOM.fromMutationObserver(foo, {
attributes: true,
childList: true,
characterData: true,
attributeFilter: ["id", "dir"]
});
foo.dir = 'rtl';
// Listen for mutations
obs.subscribe(function (mutations) {
mutations.forEach(function(mutation) {
console.log("Type of mutation: " + mutation.type);
if ("attributes" === mutation.type) {
console.log("Old attribute value: " + mutationRecord.oldValue);
}
});
});Last updated