Last active
September 4, 2017 04:13
-
-
Save blacktm/8165811 to your computer and use it in GitHub Desktop.
A JavaScript revealing module pattern template.
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
/* | |
* module.js - The description of the module. | |
*/ | |
var Module = (function () { | |
// Properties | |
/////////////////////////// | |
var x = 0; | |
// Private Methods | |
/////////////////////////// | |
/* | |
* An example private method. | |
*/ | |
var privateMethod = function () {}; | |
// Public Methods | |
/////////////////////////// | |
/* | |
* An example public method. | |
*/ | |
var publicMethod = function () {}; | |
// Init | |
/////////////////////////// | |
x = 10 + x; | |
// Reveal public methods | |
return { | |
publicMethod: publicMethod | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment