-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not just use AMD define #2
Comments
Because with current approach you can create numerous isolated module containers in your page, e.g.: var Navigation = new Mods();
Navigation.define('Menu', function() {
//...
});
var Content = new Mods();
Content.define('ArticlePopup', function() {
}); However you can always fallback to the desired (AMD-like) approach: var MyApp = new Mods();
window.define = function(name, mod) {
MyApp.define(name, mod);
};
window.get = function(name) {
return MyApp.get(name);
}; If it's really critical to you, I can add this functionality into the lib. |
What use case does isolated module trees solve over a single module tree? It looks very interesting though - and an amazingly small footprint, fascinating code. Thanks for explaining. |
Thank you for your interest in mods. |
is entirely supported by AMD, and concatenates for builds.
If you really wanted to push this technique, could you not push it with the existing toolset?
What isn't supported by RequireJS or Almond with the above that necessitates writing a new tool?
The text was updated successfully, but these errors were encountered: