queue-run icon indicating copy to clipboard operation
queue-run copied to clipboard

Prefetch resources

Open assaf opened this issue 3 years ago • 0 comments

Common usage for warmup is to fetch resources.

  • prefetch.add(url, fetcher?) adds a resource with the URL and immediately starts loading it
  • prefetch.get(url) waits for resource to load and returns it
  • Fetcher function called with the URL, should return an object
  • Default behavior: load resource, fail unless 200/304, parse if JSON
  • Use with Google OAuth: prefetch.add(auth.google.prefetch)

assaf avatar Feb 06 '22 23:02 assaf