Skip to content

Instantly share code, notes, and snippets.

@jasonwyatt
jasonwyatt / MySingleton.js
Created Jul 26, 2011
Singleton Pattern with Require JS
View MySingleton.js
define(function(){
var instance = null;
function MySingleton(){
if(instance !== null){
throw new Error("Cannot instantiate more than one MySingleton, use MySingleton.getInstance()");
}
this.initialize();
}