Created
September 30, 2020 03:46
-
-
Save oahehc/dd760a97cfdef34b386aae213f7275cc 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
self.addEventListener("activate", (event) => { | |
event.waitUntil( | |
caches.keys().then((cacheNames) => { | |
const promiseArr = cacheNames.map((item) => { | |
if (item !== CACHE_NAME) { | |
return caches.delete(item); | |
} | |
}); | |
return Promise.all(promiseArr); | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment