Rajesh
Rajesh

Reputation: 632

How do I preload my RunAsync code splits

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?

Upvotes: 3

Views: 258

Answers (1)

Riley Lark
Riley Lark

Reputation: 20890

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

Upvotes: 1

Related Questions