Singletons of EXTJS
Otherwise known as the module design pattern this pattern allows you to create private JS Variables or methods through the clever use of closures. The singleton is a good pattern to use when you you have a class of static methods, or you have a class that will on
MyApp = function(){
var data; da ta is private and can't be accessed from outside.
return {
init: function(){
// Initialize application here
},
getData: function(){
return data;
}
};
}();
Ext.onReady(MyApp.init, MyApp);