Primo Committ

This commit is contained in:
paolo
2018-10-12 16:42:54 +02:00
commit a2673c0502
69 changed files with 13197 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
/*
* This file is picked up by the build system only
* when building for PRODUCTION
*/
import {register} from 'register-service-worker'
register(process.env.SERVICE_WORKER_FILE, {
ready() {
console.log('READY::: App is being served from cache by a service worker.')
},
registered(registration) { // registration -> a ServiceWorkerRegistration instance
console.log('REGISTERED::: !!!')
},
cached(registration) { // registration -> a ServiceWorkerRegistration instance
console.log('CACHED::: Content has been cached for offline use.')
},
updatefound(registration) { // registration -> a ServiceWorkerRegistration instance
console.log('UPDATEFOUND::: New content is downloading.')
},
updated(registration) { // registration -> a ServiceWorkerRegistration instance
console.log('New content is available; please refresh.')
},
offline() {
console.log('No internet connection found. App is running in offline mode.')
},
error(err) {
console.error('Error during service worker registration:', err)
},
}
);
// ServiceWorkerRegistration: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration