Reputation: 7237
Trying to learn Sencha...
I came across the following code in a controller:
onViewMoreEventTap: function() {
var me = this;
Ext.callback(function(){
me.getView().fireEvent('onViewMoreEventTap');
}, me, [], 1);
}
What is the significance of passing an anonymous function to Ext.callback?
What does the snippet do in overall?
Upvotes: 0
Views: 2088
Reputation: 5856
There are a couple of purposes for Ext.callback:
In this case it is because the author want to execute the inline function 1ms later (purpose 3). In JavaScript, executing some code 1ms later is a kind of multitasking that is not natively supported.
Upvotes: 1