The design of this has some issues. It requires calling YUI use for each public / private method. Nonethless, this is how you setup a javascript module using module pattern and YUI namepsace.
Last active
August 29, 2015 13:58
-
-
Save chrisjlee/10399857 to your computer and use it in GitHub Desktop.
Using the YUI namespace function to create a javascript module
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
YUInstance = YUI(); | |
YUInstance.namespace('MYNAMESPACE.module'); | |
MYNAMESPACE.module = (function () { | |
function private() { | |
// Do magic | |
} | |
return { | |
init: function () { | |
private(); | |
} | |
} | |
})(YUInstance); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment