self.showPanel();
self.updateSliderValue();
self.addPoints(1,2,3);
self.setOptions();
self.removeValues();
addPoints method adds points to app and it takes quite lot of time, so I want it running in background and the app goes to setOptions and other functions below it. Please help.
javascript is a single thread application, that means there is nothing like a background thread to run.
What you can do is run the function addPoints after the main function is completed, you can use setTimeout to do that
setTimeout(function(){
self.addPoints(1,2,3);
}, 0)
This will defer the execution of addPoints till the current script executions are over.
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