Created
July 8, 2011 06:59
-
-
Save lukemartin/1071281 to your computer and use it in GitHub Desktop.
JavaScript: Loose augmentation 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
// Global UI object | |
var UI = UI || {}; | |
UI.Generic = (function($) { | |
var my = {}; | |
// Public | |
my.foo = "Something"; | |
my.bar = function() { | |
return "Something else"; | |
}; | |
my.Cat = {}; | |
my.Cat.init = function() { | |
return; | |
}; | |
// Private | |
var hat = 2; | |
var dingo = function() { | |
return; | |
}; | |
return my; | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment