Skip to content

Instantly share code, notes, and snippets.

@smeghead
Created April 23, 2014 07:04
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 smeghead/11205195 to your computer and use it in GitHub Desktop.
Save smeghead/11205195 to your computer and use it in GitHub Desktop.
testの戻り値がtrueになってから、procを実行する関数
var execAfter = function(test, proc) {
var timer = setInterval(function(){
if (test()) {
clearInterval(timer);
proc();
return;
}
}, 500);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment