Last active
December 19, 2015 10:49
-
-
Save zhusee2/5943380 to your computer and use it in GitHub Desktop.
Example script files from the concept of "Structure JavaScript with Module Pattern" on CSS-Tricks. (http://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/)
This file contains 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
var NewsWidget = { | |
init: function() { | |
// Do some init stuffs | |
} | |
otherMethods: function() { | |
// Expend the ability of the widget | |
} | |
}; |
This file contains 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
//= require common/library.js | |
//= require module/news-widget.js | |
//= require module/some-other-widget.js | |
(function() { | |
NewsWidget.init(); | |
SomeOtherModule.init(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment