Hi All,
I have a long processing logic and i want to show user a loading indicator it is processing in other thread.
Any ideas,
Thanks
Hi All,
I have a long processing logic and i want to show user a loading indicator it is processing in other thread.
Any ideas,
Thanks
Unless things have changed, I believe JavaScript is single-threaded, so there are only 2 options that come to mind:
Thanks you for the reply.
I would like to give more about my problem. I store my pretty big data in the localstorage. And i want to show a user the loading indicator while this data is being query.
Your solution 1: Is it possible to access the localStorage from the C++, Objective-c or Java? (if possible, would you mind point me the sample code?)
Solution 2: Would u mind point me the sample code?
There does appear to be code related to LocalStorage in C++, but I have not used it so I can’t say for certain or how to use it.
Not sure what exactly you are doing with your data, so I’m not sure how best to provide sample code (and I haven’t written JS code in a while), but it would be something like:
nextWork:function() {
// do your next work with your data
// update your loading indicator
this.updateLoadingIndicator();
// wait until the next frame to do more work to give the app
// time to refresh the screen
this.scheduleOnce(this.nextWork);
}
You just need to keep track of where you are at with your data so nextWork
knows what to do next.