public
Created

dependency injection

  • Download Gist
require_provide.js
JavaScript
1 2 3 4 5 6 7 8
// require two modules
require(["requiredModuleOne", "requiredModuleTwo"],
// run this callback when modules are loaded
function(moduleOne, moduletwo) {
// explicitly declare a dependency is available
provide(newModuleName, resultWhenRequired);
}
);

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.