Skip to content

Instantly share code, notes, and snippets.

@XavierGeerinck
Last active March 20, 2018 17:11
Show Gist options
  • Save XavierGeerinck/98a9e6518f6f81137580d1028f0b22a2 to your computer and use it in GitHub Desktop.
Save XavierGeerinck/98a9e6518f6f81137580d1028f0b22a2 to your computer and use it in GitHub Desktop.
let isWorking = false;
setInterval(() => {
if (isWorking) {
return;
}
isWorking = true;
console.log('do something (example: download URL)');
isWorking = false;
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment