Last active
December 25, 2015 04:39
-
-
Save EdCharbeneau/6919216 to your computer and use it in GitHub Desktop.
Revealing module pattern stub
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
| var module = function () { | |
| //private | |
| var someFunction = function(message){ ... }, | |
| privateFunction = function() { ... } | |
| onInit = function(settings) { ... }; | |
| return { | |
| //public | |
| init: onInit | |
| publicFunction: someFunction | |
| } | |
| } (); | |
| //usage | |
| $(document).ready(function () { | |
| module.init(); | |
| module.publicFunction("Testing 123"); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also: http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html