Created
July 24, 2022 17:54
-
-
Save damienwebdev/7f9f1694f3369cc14e16ef88173bed94 to your computer and use it in GitHub Desktop.
Showcases memory leaks on page changes.
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
const PAGE_1 = document.querySelector('YOUR_SELECTOR'); | |
const PAGE_2 = document.querySelector('YOUR_OTHER_SELECTOR'); | |
let count = 0; | |
const memleakInterval = setInterval(() => { | |
count % 2 === 0 ? PAGE_1.click() : PAGE_2.click(); | |
count++; | |
console.log(count); | |
}, 1000); | |
//clearInterval(memleakInterval); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment