Skip to content

Commit

Permalink
curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
ninofiliu committed Mar 4, 2021
1 parent 03b3486 commit dbf380c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ <h3 id="The_service_worker">The service worker</h3>
e.respondWith((async () =&gt; {
const r = await caches.match(e.request);
console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
if (r) return r;
if (r) { return r; }
const response = await fetch(e.request);
const cache = await caches.open(cacheName);
console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h3 id="Responding_to_fetches">Responding to fetches</h3>
e.respondWith((async () =&gt; {
const r = await caches.match(e.request);
console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
if (r) return r;
if (r) { return r; }
const response = await fetch(e.request);
const cache = await caches.open(cacheName);
console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
Expand Down Expand Up @@ -181,7 +181,7 @@ <h2 id="Clearing_the_cache">Clearing the cache</h2>
e.waitUntil((async () =&gt; {
const keyList = await caches.keys();
await Promise.all(keyList.map((key) =&gt; {
if (key === cacheName) return;
if (key === cacheName) { return; }
await caches.delete(key);
}))
})());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ <h3 id="The_service_worker">The service worker</h3>
e.respondWith((async () =&gt; {
const r = await caches.match(e.request);
console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
if (r) return r;
if (r) { return r; }
const response = await fetch(e.request);
const cache = await caches.open(cacheName);
console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
Expand Down

0 comments on commit dbf380c

Please sign in to comment.