Created
January 24, 2023 22:00
-
-
Save tobiu/054482bb628b1b26f7ce824ea3d343d5 to your computer and use it in GitHub Desktop.
Neo.core.Base
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The base class for (almost) all classes inside the Neo namespace | |
* Exceptions are e.g. core.IdGenerator, vdom.VNode | |
* @class Neo.core.Base | |
*/ | |
class Base { | |
/** | |
* Set this one to false in case you don't want to stick | |
* to the "anti-pattern" to apply classes to the global Neo or App namespace | |
* @member {Boolean} registerToGlobalNs=true | |
* @protected | |
* @static | |
*/ | |
static registerToGlobalNs = true | |
/** | |
* Configs will get merged throughout the class hierarchy | |
* @returns {Object} config | |
* @tutorial 02_ClassSystem | |
*/ | |
static config = { | |
/** | |
* The class name which will get mapped into the Neo or app namespace | |
* @member {String} className='Neo.core.Base' | |
* @protected | |
*/ | |
className: 'Neo.core.Base', | |
/** | |
* The class shortcut-name to use for e.g. creating child components inside a JSON-format | |
* @member {String} ntype='base' | |
* @protected | |
*/ | |
ntype: 'base', | |
/** | |
* The unique component id | |
* @member {String|null} id_=null | |
*/ | |
id_: null, | |
/** | |
* Neo.create() will change this flag to true after the onConstructed() chain is done. | |
* @member {Boolean} isConstructed=false | |
* @protected | |
*/ | |
isConstructed: false, | |
/** | |
* Add mixins as an array of classNames, imported modules or a mixed version | |
* @member {String[]|Neo.core.Base[]|null} mixins=null | |
*/ | |
mixins: null, | |
/** | |
* You can create a new instance by passing an imported class (JS module default export) | |
* @member {Class} module=null | |
* @protected | |
*/ | |
module: null | |
} | |
// ... | |
} | |
Neo.applyClassConfig(Base); | |
export default Base; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment