Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Last active November 6, 2015 21:38
Show Gist options
  • Save ericelliott/3701667 to your computer and use it in GitHub Desktop.
Save ericelliott/3701667 to your computer and use it in GitHub Desktop.
Flyweight Factory Module Pattern
var myPrototype = {
methodA: function methodA() {},
methodB: function methodB() {},
methodC: function methodC() {}
};
createFoo = function createFoo() {
return (Object.create(myPrototype));
};
@szahn
Copy link

szahn commented Dec 11, 2014

Great example of an alternative to constructors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment