docs(service-worker): improve SwRegistrationOptions
docs and add example (#21842)
PR Close #21842
This commit is contained in:

committed by
Andrew Kushnir

parent
be28a6ad8e
commit
aa53d6cc6d
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
// Mock `ngsw-worker.js` used for testing the examples.
|
||||
// Immediately takes over and unregisters itself.
|
||||
self.addEventListener('install', evt => evt.waitUntil(self.skipWaiting()));
|
||||
self.addEventListener(
|
||||
'activate',
|
||||
evt => evt.waitUntil(self.clients.claim().then(() => self.registration.unregister())));
|
Reference in New Issue
Block a user