Skip to content

Instantly share code, notes, and snippets.

@ondrek
Created April 11, 2014 12:45
Show Gist options
  • Save ondrek/10465771 to your computer and use it in GitHub Desktop.
Save ondrek/10465771 to your computer and use it in GitHub Desktop.
Sexy Javascript architecture
var Downpress = function(){
this.doSomethingCool();
this.doSomethingElse();
this.doSomethingNext();
};
Downpress.prototype.doSomethingCool = function(){};
Downpress.prototype.doSomethingElse = function(){};
Downpress.prototype.doSomethingNext = function(){
this.coolEncaps.func1();
this.coolEncaps.func2();
this.coolEncaps.func3();
};
Downpress.prototype.coolEncaps = {
func1 : function(){},
func2 : function(){},
func3 : function(){}
};
new Downpress();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment