This function will transform any given function into singleton pattern
MIT-style license.
Takashi Mizohata beatak@nydd.org
2008 [nydd](http://code.nydd.org/).
| Singleton.js | This function will transform any given function into singleton pattern |
| Functions | |
| Singleton | This function will transform any given function into singleton pattern |
var Singleton = function ( str )
This function will transform any given function into singleton pattern
| str | (String) Very important! You have to pass a name of the object by string |
(Object)
var Foo = function () {...}
Foo.prototype.bar = function () {...}
Foo = Singleton('Foo');
var a = Foo.getInstance(); // ok!
var b = new Foo() // -> raise an errorThis function will transform any given function into singleton pattern
var Singleton = function ( str )