Created
March 22, 2018 07:53
-
-
Save vldvel/5a56eb5c423fcd9e0c26c532b642306d to your computer and use it in GitHub Desktop.
MutationObserver constructor
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 characters
| // create subscriber | |
| function subscriber (mutations) { | |
| mutations.forEach((mutation) => { | |
| console.log(mutation); | |
| }); | |
| } | |
| // create observer | |
| const observer = new MutationObserver(subscriber); | |
| // observer methods | |
| for (const prop in observer.__proto__) { | |
| console.log(prop); // observe, disconnect, takeRecords | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment