Skip to content

Instantly share code, notes, and snippets.

@mzgoddard
Created February 1, 2012 19:04
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 mzgoddard/1718679 to your computer and use it in GitHub Desktop.
Save mzgoddard/1718679 to your computer and use it in GitHub Desktop.
New Wrapper
// this is an idea, a paradigm, not a function that is reused
// an example with World
wrapper.World = function(options) {
this.stuff = stuff;
};
bullet.world = function(options) {
return new wrapper.World(options);
};
// the "wrapper" is a light-weight function that returns a new instance of an object.
// a factory function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment