Skip to content

Instantly share code, notes, and snippets.

@kyuwoo-choi
Created July 23, 2017 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyuwoo-choi/ff179e3eda472aed70c8bd09a13d9112 to your computer and use it in GitHub Desktop.
Save kyuwoo-choi/ff179e3eda472aed70c8bd09a13d9112 to your computer and use it in GitHub Desktop.
...
this._disconnectedObserver = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (mutation.type === 'childList' &&
Array.prototype.slice.call(mutation.removedNodes).indexOf(this._el) >= 0) {
...
}
});
});
this._disconnectedObserver.observe(this._el.parentNode, {
childList: true
});
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment