single

implements the singleton pattern

function single(function source);
sourcefunctionthe constructor function
functionthe constructor function

Example

var myobj = function(){ ... };
myobj = webix.single(myobj);
 
var t1 = new myobj();
var t2 = new myobj(); //t2 === t1

Back to top