Module

service-worker-helper

This namespace contains helpers for building a service worker. This namespace only exports initializeQServiceWorker.

See Setting up Push Notifications for an example of setting up push notifications.

import { initializeQServiceWorker } from "@quintype/framework/client/service-worker-helper";

View Source client/service-worker-helper.js, line 1

void

Methods

# static initializeQServiceWorker(self, params)

Start the Service Worker.

Parameters:
Name Type Description
self ServiceWorkerScope
params Object
excludeNavigation function

A function to exclude the PWA from serving the shell on that route, even if the route matches as per routes.

routes Array.<Route>

An array of routes for the PWA to match

assets Array.<string>

A list of assets to be cached before the ServiceWorker is installed

mountAt string | undefined

Mount point for the routes to be mounted

shell string

Path for the shell. Default '/shell.html'

View Source client/service-worker-helper.js, line 46