Last active
August 29, 2015 14:18
-
-
Save floriankraft/94fdea1aee5c5382ab28 to your computer and use it in GitHub Desktop.
Scaffold for the Javascript Module Pattern.
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 NamespaceName = NamespaceName || {}; | |
NamespaceName.ModuleName = function () { | |
var aPublicProperty = "foo"; | |
var aPrivateProperty = "bar"; | |
var init = function () { | |
// some code here ... | |
}; | |
var aPrivateFunction = function () { | |
// some code here ... | |
}; | |
var aPublicFunction = function () { | |
// some code here ... | |
}; | |
return { | |
aPublicProperty: aPublicProperty, | |
init: init, | |
aPublicFunction: aPublicFunction | |
}; | |
}(); | |
NamespaceName.ModuleName.aPublicProperty; | |
NamespaceName.ModuleName.init(); | |
NamespaceName.ModuleName.aPublicFunction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment