Skip to content

Instantly share code, notes, and snippets.

@illepic
Created August 8, 2015 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illepic/5debd7bb4fa0651dd87d to your computer and use it in GitHub Desktop.
Save illepic/5debd7bb4fa0651dd87d to your computer and use it in GitHub Desktop.
var Model = (function() {
console.log('model');
})();
var View = (function() {
console.log("I am module 1");
})();
var AuthCheck = (function() {
return {
doCheck: function() {
console.log('we checked the user!');
}
}
})();
var Game = (function(View, Model, AuthCheck) {
var doSomething = function() {
console.log("doSomething Ran");
console.log(this);
return this;
};
var doSomethingElse = function(thingy) {
console.log("print object", thingy);
console.log(this);
return this;
};
var doUserCheck = function() {
AuthCheck.doCheck();
return this;
};
// 15 helper functions
return {
init: doSomethingElse,
render: doSomething,
checkUserYo: doUserCheck
};
})(View || {}, Model || {}, AuthCheck);
var AppYo = (function(Game) {
console.log(Game);
var memoryItems = [1, 2, 3, 4, 5, 6, 7, 8];
Game.init(memoryItems).checkUserYo().render();
})(Game);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment