Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I preload my RunAsync code splits

Tags:

gwt

I have split my module with GWT.RunAsync to load faster for the first time. But once it is loaded, I want to load all other code splits as user will be idle for some time, and it will be faster for him to work on those parts when needed.

Any one have tried to do this? Any simple way of doing?

like image 275
Rajesh Avatar asked Feb 21 '26 08:02

Rajesh


1 Answers

You can call GWT.RunAsync with a callback function that may or may not run the newly-loaded code. In the case where the code isnt' run, the callback turns into a no-op... with the handy side-effect of loading the rest of the code.

See "prefetching" at http://code.google.com/webtoolkit/doc/latest/DevGuideCodeSplitting.html#patterns

like image 95
Riley Lark Avatar answered Feb 22 '26 21:02

Riley Lark



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!