Skip to content

Instantly share code, notes, and snippets.

@webmaxru
Created February 27, 2019 23:16
Show Gist options
  • Save webmaxru/1053089061e68642a70b41e09cf3c933 to your computer and use it in GitHub Desktop.
Save webmaxru/1053089061e68642a70b41e09cf3c933 to your computer and use it in GitHub Desktop.
Workbox 4: workbox-window. Registering service worker
import { Workbox } from 'workbox-window';
if ('serviceWorker' in navigator) {
const wb = new Workbox('service-worker.js');
wb.register();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment