Last active
December 24, 2015 01:29
-
-
Save brschwar/6724515 to your computer and use it in GitHub Desktop.
Revealing Module Pattern
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
// module declaration | |
var Module = (function () { | |
var _privateFunction = function () { | |
// private logic | |
}; | |
var publicFunction = function () { | |
// public logic | |
}; | |
// publicly exposed API (revealed) | |
return { | |
public: publicFunction | |
}; | |
})(); | |
// usage | |
Module.public(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment