Skip to content

Instantly share code, notes, and snippets.

@mikemadisonweb
Created August 11, 2016 07:58
Show Gist options
  • Save mikemadisonweb/d05ffa6261c453ad62fdd0ee427cca4f to your computer and use it in GitHub Desktop.
Save mikemadisonweb/d05ffa6261c453ad62fdd0ee427cca4f to your computer and use it in GitHub Desktop.
var yourApp = (function (/* outer scope variables*/) {
function User () {
/* stuff */
}
User.prototype.someMethod (arg) {
state.users[this.id].something = arg;
}
function App () {
/* stuff */
}
var state = {
/* app state stuff */
users: {
/* user state stuff */
}
};
return {
user: function () { return new User(); },
app: function () { return new App(); }
}
})(/* outer scope variables */);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment