Wait data to start javascript transformer

It looks as though there's a significant amount of logic in the script you have that's processing the query results so I'm hesitant to make a super strong recommendation here. You might want to explore looking at the developer network to see if you can find someone who can work more closely on your app with you.

For localStorage, you can set it using the setValue method described here. Once you've done so, it should persist between apps. You can then access the values you've set using localStorage.values.yourKeyName.

That being said, it's possible that refactoring your code could make it easier to paginate your query and also just increase performance generally and might be a better way to go than storing things in localStorage.