asynchronous functions

  • 1
  • Question
  • Updated 3 years ago
  • Answered
This is the code that is generated automatically for an inline snippet

(function(skuid){
var $ = skuid.$;
$(function(){
var myModel = skuid.model.getModel('MyModelId');
var myComponent = skuid.component.getById('MyComponentUniqueId');
// window.alert('hello');
});
})(skuid);

I think this means that whatever is in the inner "function" call will be executing without blocking the page. Is that right ? That's what I want to happen, as I want to do an update on some of the page models without making the user wait til the update is finished.

Thanks
Ken
Photo of ktyler

ktyler

  • 9,244 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
This will not block the user unless you add code to do so.

Question then becomes, what are you going to be doing in the function? Calls to the server will likely cause a delayed UI reaction and could cause an adverse user experience.
(Edited)