Created
August 1, 2012 11:11
-
-
Save byrichardpowell/3225862 to your computer and use it in GitHub Desktop.
Prototype Pattern
This file contains 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
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