Created
June 11, 2015 20:32
-
-
Save lorenzoongithub/ce6ae3423b318524327e to your computer and use it in GitHub Desktop.
waitUntil.js
This file contains hidden or 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
// | |
// An example to show the 'waitUntil' function | |
// | |
var x = 0; | |
setTimeout(function() { x = 1; },1000); | |
waitUntil(x==1); | |
setTimeout(function() { x = 2; },2000); | |
waitUntil(x==2); | |
setTimeout(function() { x = 3; },3000); | |
waitUntil(x==3); | |
'I am done'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment