/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/service-worker/safety-worker.js
30 строк
785 B
Joey Perrott
refactor: update license text to point to angular.dev (#57901)
24 сен 2024, 16:33
24 сен 2024, 16:33
9dbe6fc
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC 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.dev/license */ // tslint:disable:no-console self.addEventListener('install', (event) => { self.skipWaiting(); }); self.addEventListener('activate', (event) => { event.waitUntil(self.clients.claim()); event.waitUntil( self.registration.unregister().then(() => { console.log('NGSW Safety Worker - unregistered old service worker'); }), ); event.waitUntil( caches.keys().then((cacheNames) => { const ngswCacheNames = cacheNames.filter((name) => /^ngsw:/.test(name)); return Promise.all(ngswCacheNames.map((name) => caches.delete(name))); }), ); });