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?
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?
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: