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:
// do your next work with your data
// update your loading indicator
// wait until the next frame to do more work to give the app
// time to refresh the screen
You just need to keep track of where you are at with your data so
nextWork knows what to do next.