Created
May 14, 2023 21:24
-
-
Save protomorph/a07aae77ba47f069b7a8535bfbbd5b97 to your computer and use it in GitHub Desktop.
Revisions
-
protomorph created this gist
May 14, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ function observeMutations (element, callback, options) { const observer = new MutationObserver(mutations => mutations.forEach(m => callback(m)) ) observer.observe(element, Object.assign({ childList: true, attributes: true, attributeOldValue: true, characterData: true, characterDataOldValue: true, subtree: true, }, options)) return observer }