Created
April 23, 2014 07:04
-
-
Save smeghead/11205195 to your computer and use it in GitHub Desktop.
testの戻り値がtrueになってから、procを実行する関数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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