-
-
Save unbug/6fb7c51c93d8e5b5031d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EntryPoint.js | |
define(function () { | |
return function EntryPoint(model1, model2) { | |
// stuff | |
}; | |
}); | |
// Model1.js | |
define(function () { | |
return function Model1() { | |
// stuff | |
}; | |
}); | |
// Model2.js | |
define(function () { | |
return function Model2(helper) { | |
// stuff | |
}; | |
}); | |
// Helper.js | |
define(function () { | |
return function Helper() { | |
// stuff | |
}; | |
}); | |
// composition root, probably your main module | |
define(function (require) { | |
var EntryPoint = require("./EntryPoint"); | |
var Model1 = require("./Model1"); | |
var Model2 = require("./Model2"); | |
var Helper = require("./Helper"); | |
var entryPoint = new EntryPoint(new Model1(), new Model2(new Helper())); | |
entryPoint.start(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment