partey_workadventure/front/dist/service-worker-dev.js
Gregoire Parant 434b112c65 Improve service worker store managment
Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
2021-08-11 10:01:56 +02:00

30 lines
640 B
JavaScript

let CACHE_NAME = 'workavdenture-cache-dev';
let urlsToCache = [
'/'
];
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(CACHE_NAME)
.then((cache) => {
return cache.addAll(urlsToCache);
})
);
});
self.addEventListener('fetch', (event) => {
//never cache data will be stored in dev mode
});
self.addEventListener('wait', function(event) {
//TODO wait
});
self.addEventListener('update', function(event) {
//TODO update
});
self.addEventListener('beforeinstallprompt', (e) => {
//TODO change prompt
});