Skip to content

Instantly share code, notes, and snippets.

@notthetup
Created April 6, 2015 08:17
Show Gist options
  • Save notthetup/7eaf66f16e3721971d5a to your computer and use it in GitHub Desktop.
Save notthetup/7eaf66f16e3721971d5a to your computer and use it in GitHub Desktop.
Load Manager
var toLoad = 0;
function loadManager(callback){
toLoad++;
var onload = function(){
toLoad--;
if (typeof callback === 'function'){
callback();
}
if (toLoad === 0){
if (typeof onLoadAll === 'function'){
onLoadAll();
}
}
}
return onload;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment