LynxResourcePrefetch
Download images and videos into the native cache before they're shown, so they appear without a delay. import { LynxResourcePrefetch, type PrefetchRequest, type PrefetchPriority, type PrefetchCacheTarget, type PrefetchResultDetail } from '@blotch/angular-lynx';
Usage
API
LynxResourcePrefetch
Asks Lynx to fetch resources into its image and video caches.
Lynx provides prefetching only on the background thread. On the main thread, which runs your event handlers, both methods reject. A constructor runs on both threads, so the call in Usage reaches Lynx from the background copy. See Threads.
LynxResourcePrefetch.request()
Starts prefetching. Resolves when Lynx accepts the request, which can be before the downloads finish. Rejects when prefetching isn't available.
LynxResourcePrefetch.cancel()
Cancels prefetches that are still running, for example when the user leaves the screen. Rejects when prefetching isn't available.
Types
PrefetchRequest
PrefetchPriority
PrefetchCacheTarget
PrefetchResultDetail
The result for one resource.
ResourcePrefetchResult
The overall result, with one details entry for each resource.
