Skip to content

Instantly share code, notes, and snippets.

@byrichardpowell
Created August 1, 2012 11:11
Show Gist options
  • Save byrichardpowell/3225862 to your computer and use it in GitHub Desktop.
Save byrichardpowell/3225862 to your computer and use it in GitHub Desktop.
Prototype Pattern
DependencyMap = function( config ) {
var Map = function( config ) {
this.w = config.w;
this.h = config.h;
this.wrapper = config.wrapper;
}
var proto = Map.prototype;
proto.draw = function() {
}
DependencyMap = function( config ) {
return new Map( config );
}
return DependencyMap( config );
}
myMap = DependencyMap({w:20,h:20,'wrapper':'#myId'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment