Skip to content

Instantly share code, notes, and snippets.

@kenchangh
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenchangh/e2c5c3c2b86c5cb42c40 to your computer and use it in GitHub Desktop.
Save kenchangh/e2c5c3c2b86c5cb42c40 to your computer and use it in GitHub Desktop.
Checks if asynchronous function is finished
function asyncChecker(condition, callback, interval) {
var checkerInterval = setInterval(function() {
if (condition) {
clearInterval(checkerInterval);
callback();
}
}, interval);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment