PDA

View Full Version : Asynchronous loading and Ext.create



wickedsick
25 Feb 2014, 7:13 PM
How works the Ext.create?

var person = Ext.create('Person', {....})

when you use that and set requires, extend then load the files first and after that create a instance of the class and you can assign to the variable the instance. How to do that if javascript load the files asynchronously and you need return the correct instance. What is the mechanism for wait until the files are loaded and continue with the execution of javascript, using the while, calling the same function in the stack, both case I think is not the big deal. I know the people use callback but the javascript don't stop the execution then how is possible the variable person has the correct instance of Person Class

brian428
25 Feb 2014, 10:21 PM
Runtime loading of unloaded but required classes is synchronous, not asynchronous. So nothing else happens until the class has been loaded into the ClassManager.