Created
November 17, 2020 18:13
-
-
Save amadeus/df0d00421b60c9fcbe8cd999a08318e8 to your computer and use it in GitHub Desktop.
This file contains 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 memTester = (() => { | |
const api = { | |
_timer: null, | |
start() { | |
if (api._timer != null) { | |
api.end(); | |
} | |
let back = true; | |
api._timer = setInterval(() => { | |
if (back) { | |
window.history.back(); | |
back = false; | |
} else { | |
window.history.forward(); | |
back = true; | |
} | |
}, 100) | |
}, | |
end() { | |
clearInterval(api._timer); | |
api._timer = null; | |
} | |
} | |
return api | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment