Skip to content

Instantly share code, notes, and snippets.

@ryedin
Created October 20, 2010 16:53
Show Gist options
  • Save ryedin/636813 to your computer and use it in GitHub Desktop.
Save ryedin/636813 to your computer and use it in GitHub Desktop.
pseudo-code
var ready = false,
readyCallbacks = [];
function onReady(callback) {
if (ready) return callback();
readyCallbacks.push(callback);
}
function signalReady() {
ready = true;
for (var i = 0, l = readyCallbacks.length; i < l; i++) {
(readyCallbacks[i])();
}
}
...blah blah blah
...something(s) is(are) defined that should == app is ready
signalReady();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment