Created
April 19, 2015 15:28
-
-
Save pixelhijack/2776fd2ce3deb6a7abaf to your computer and use it in GitHub Desktop.
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 MODEL = (function(m){ | |
m.num = 10; | |
return m; | |
}(MODEL || {})); | |
var UI = (function(ui, model, setter){ | |
ui.public = setter; | |
ui.DOM = (function(){ | |
var priv = model.num * ui.public; | |
return{ | |
add: function(i){ priv+=i; }, | |
public: function(){ return priv; } | |
} | |
}()); | |
return ui; | |
}(UI || {}, MODEL, 5)); | |
UI.submodule = (function(){ | |
return { | |
public: function(){ | |
UI.DOM.add(3) | |
return UI.DOM.public(); | |
} | |
} | |
}()); | |
console.clear(); | |
console.log(UI.submodule.public()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment