Skip to content

Instantly share code, notes, and snippets.

@basketofsoftkittens
Created May 14, 2012 16:55
Show Gist options
  • Save basketofsoftkittens/2695044 to your computer and use it in GitHub Desktop.
Save basketofsoftkittens/2695044 to your computer and use it in GitHub Desktop.
<<<<<<< HEAD
// recurse through dependencies object
// to count total number objects
loading = _.reduce(deps, function(total, val) {
var count =
_.isFunction(val) ? 1 :
_.isArray(val) ? val.length :
_.isObject(val) ? _.keys(val).length : 0;
return count + total;
}, 0);
// return if no dependencies
if(_.isEmpty(deps) || loading === 0) { return resourcesLoaded(); }
=======
// no dependencies
if(_.isEmpty(deps)) { return resourcesLoaded(); }
// recurse through dependencies object
// to count total number objects
loading = _.reduce(deps, function(total, val) {
var count =
_.isFunction(val) ? 1 :
_.isArray(val) ? val.length :
_.isObject(val) ? _.keys(val).length : 0;
return count + total;
}, 0);
>>>>>>> master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment