Ext.define('...', {
uses: ['...'],
});
and
Ext.define('...', {
requires: ['...'],
});
I am a bit confused...Do they have common ground at all? When do we use one or the other?
Requires - All classes required to be defined for the class to be instantiated. Uses - A list of classes potentially used by the class at some point in its lifecycle, but not necessarily requried for the class to initially be instantiated. Subclasses - Classes that extend the current class.
Ext JS is a popular JavaScript framework which provides rich UI for building web applications with cross-browser functionality. Ext JS is basically used for creating desktop applications. It supports all the modern browsers such as IE6+, FF, Chrome, Safari 6+, Opera 12+, etc.
It is a free, limited commercial use license, with robust Ext JS Frameworks, hundreds of modern components, a material theme, and more to develop stunning-looking apps.
It's pretty much covered by the documentation:
Uses are optional class dependencies that are used by, but not required by, a class. These can be loaded asynchronously and do not have to be available for the class to be instantiated.
For example, if it's something your class instantiates Foo in the constructor, then it should be in requires
.
If it instantiates Foo in some method that might get called later by the developer, it could go in uses
.
'requires' are needed to create a class, 'uses' are needed to create an object of that class.
The event sequence is:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With