Last active
December 20, 2015 12:29
-
-
Save jakelazaroff/6131369 to your computer and use it in GitHub Desktop.
RequireJS module example. This is how I keep my dependency list organized!
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
define([ | |
// models | |
'models/someModel', 'models/someOtherModel', | |
// collections | |
'collections/someCollection', | |
// views | |
'views/someView', 'views/someOtherView', | |
// templates | |
'text!templates/someTemplate.html', 'text!templates/someOtherTemplate.html', | |
// plugins | |
'vendor/jquery/somePlugin' | |
], function ( | |
// models | |
someModel, someOtherModel, | |
// collections | |
someCollection, | |
// views | |
someView, someOtherView, | |
// templates | |
someTemplate, someOtherTemplate, | |
) { | |
// ... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about:
I find this syntax is easier to handle for larger dependency lists.