Skip to content

Instantly share code, notes, and snippets.

@amadeus
Created November 17, 2020 18:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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