Search code examples
javascriptclassextjs

Extjs use class/singelton in different applications


How can I use a custom class with basic functions in multiple projects / applications?

I obviously do not want to copy it

Ext.define('util.ConfigData', {
    singleton: true,

    _debug: false,
    log: function(message) {
        if(this._debug){
            console.log(message);
        }
    }

});


Solution

  • Thank you @Dinkheller that worked for me.

    The links

    https://docs.sencha.com/cmd/7.4.0/guides/cmd_packages/cmd_creating_packages.html

    and

    https://docs.sencha.com/cmd/7.4.0/guides/cmd_packages/cmd_packages.html

    are showing how do to it. Follow the description and it will work.