Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Chained timeouts
var moves = []..
function makeMove() {
var m = moves.shift();
if(!m) {
return everythingDone();
}
setTimeout(function() {
activateButton(m);
setTimeout(function() {
deactivateButton(m);
makeMove();
}, 250);
}, 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment