Skip to content

Instantly share code, notes, and snippets.

@amadeus
Created November 17, 2020 18:13
Show Gist options
  • Save amadeus/df0d00421b60c9fcbe8cd999a08318e8 to your computer and use it in GitHub Desktop.
Save amadeus/df0d00421b60c9fcbe8cd999a08318e8 to your computer and use it in GitHub Desktop.
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