Created
August 11, 2016 07:58
-
-
Save mikemadisonweb/d05ffa6261c453ad62fdd0ee427cca4f 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 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