Created
December 19, 2021 15:35
-
-
Save sidharrth2002/656c746ff31fba85b124e38fa6e6c927 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line no-unused-vars | |
var CACHE_NAME = "pwa-task-manager"; | |
// eslint-disable-next-line no-unused-vars | |
var urlsToCache = []; | |
// eslint-disable-next-line no-unused-vars | |
self.addEventListener("install", function (e) { | |
self.skipWaiting(); | |
}); | |
// eslint-disable-next-line no-unused-vars | |
self.addEventListener("activate", function (e) { | |
self.registration | |
.unregister() | |
.then(function () { | |
return self.clients.matchAll(); | |
}) | |
.then(function (clients) { | |
clients.forEach((client) => client.navigate(client.url)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment