Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function ResourceBuilder(){
this._dependencies = [];
ResourceBuilder.prototype.addDependency = function(dep){
ResourceBuilder.protototype.get = function(){
var loadPromises =; // alternatively, dependencies could be promises already
return Promise.all(loadPromises).then(function(loadedResourcesArray){
// do something with obj, or return the resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment