How can you create a singleton class in ExtJS?
To create a singleton class,just set to true, the class will be instantiated as singleton.
For example:
Ext.define('Logger', {
singleton: true,
log: function(msg) {
console.log(msg);
}
});
Logger.log('Hello');
Comments
Post a Comment