Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cloudinary PWA React Blog
// A new ServiceWorker is now active
self.addEventListener("activate", function (event) {
event.waitUntil(
caches.keys()
.then(function (cacheNames) {
return Promise.all(
cacheNames.map(function (cacheName) {
if (currentCacheNames.indexOf(cacheName) === -1) {
return caches.delete(cacheName);
}
})
);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment