Skip to content

Instantly share code, notes, and snippets.

@robert52
Last active May 20, 2016 11:03
Show Gist options
  • Save robert52/de4f091a5d87d266657babae8d004af5 to your computer and use it in GitHub Desktop.
Save robert52/de4f091a5d87d266657babae8d004af5 to your computer and use it in GitHub Desktop.
Simple JavaScript module pattern
var DashboardModule = (function () {
var privateVar = 'this is private var';
return {
init: function () {
// some init functionalities
},
bindHandlers: function () {
// bind jquery/event handlers
},
modifyPrivateVar: function(value) {
privateVar = value;
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment