Options
All
  • Public
  • Public/Protected
  • All
Menu

This plugin deep fetches resources during prefetching based on CSS selectors.

** Example **

 import DeepFetchPlugin from '@xdn/prefetch/sw/DeepFetchPlugin'
 import { Prefetcher } from '@xdn/prefetch/sw'

 new Prefetcher({
   plugins: [
     new DeepFetchPlugin([
       {
         selector: 'img.product-main-image,
         maxMatches: 1,
         as: 'image',
         attribute: 'src'
       }
     ])
   ]
 })

Hierarchy

  • DeepFetchPlugin

Implements

  • WorkboxPlugin

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

config

config: DeepFetchConfig[]

Methods

fetchDidSucceed

  • fetchDidSucceed(__namedParameters: { request: Request; response: Response }): Promise<Response>
  • WorkboxPlugin method called every time a fetch succeeds.

    Parameters

    • __namedParameters: { request: Request; response: Response }
      • request: Request
      • response: Response

    Returns Promise<Response>

Generated using TypeDoc