diff options
| author | caleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu> | 2022-03-07 00:33:41 -0500 |
|---|---|---|
| committer | caleb.mabry.15@cnu.edu <caleb.mabry.15@cnu.edu> | 2022-03-07 00:33:41 -0500 |
| commit | 68169fb20e0406a3bf90ff6a56acb7c1b5a7ed5f (patch) | |
| tree | 96fcc43478df2fdd25451e6d7c303cb06c3a6a29 | |
| parent | 7beba90d2ef87005fe6e12a4786101ea97c5e4fd (diff) | |
ESLint fix
| -rw-r--r-- | webAO/sw.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/webAO/sw.js b/webAO/sw.js index aba104a..09a2251 100644 --- a/webAO/sw.js +++ b/webAO/sw.js @@ -1,29 +1,26 @@ const cacheName = 'webAO'; // Cache all the files to make a PWA -self.addEventListener('install', e => { +self.addEventListener('install', (e) => { e.waitUntil( - caches.open(cacheName).then(cache => { + caches.open(cacheName).then((cache) => // Our application only has two files here index.html and manifest.json // but you can add more such as style.css as your app grows - return cache.addAll([ + cache.addAll([ './', './index.html', - '../manifest.json' - ]); - }) + '../manifest.json', + ])), ); }); // Our service worker will intercept all fetch requests // and check if we have cached the file // if so it will serve the cached file -self.addEventListener('fetch', event => { +self.addEventListener('fetch', (event) => { event.respondWith( caches.open(cacheName) - .then(cache => cache.match(event.request, { ignoreSearch: true })) - .then(response => { - return response || fetch(event.request); - }) + .then((cache) => cache.match(event.request, { ignoreSearch: true })) + .then((response) => response || fetch(event.request)), ); }); |
