-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: commit everything from repl environment
- Loading branch information
Ray Arayilakath
committed
Jun 8, 2021
1 parent
08e7e99
commit cfd7c69
Showing
8 changed files
with
107 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const cacheName = 'tether_cache_v1'; | ||
const precacheResources = [ | ||
'/', | ||
'/offline.html', | ||
'/fonts/Quantico400.woff2', | ||
'/fonts/Quantico700.woff2', | ||
'/fonts/Tulpen-One400.woff2', | ||
'/favicon.ico', | ||
'/libs/font-awesome.min.css', | ||
'/libs/fontawesome-webfont.woff' | ||
]; | ||
|
||
// When the service worker is installing, open the cache and add the precache resources to it | ||
self.addEventListener('install', (event) => { | ||
console.log('Service worker install event!'); | ||
event.waitUntil(caches.open(cacheName).then((cache) => cache.addAll(precacheResources))); | ||
}); | ||
|
||
self.addEventListener('activate', (event) => { | ||
console.log('Service worker activate event!'); | ||
}); | ||
|
||
// When there's an incoming fetch request, try and respond with a precached resource, otherwise fall back to the network | ||
self.addEventListener('fetch', (event) => { | ||
console.log('Fetch intercepted for:', event.request.url); | ||
event.respondWith( | ||
caches.match(event.request).then((cachedResponse) => { | ||
if (cachedResponse) { | ||
return cachedResponse; | ||
} | ||
return fetch(event.request); | ||
}), | ||
); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const cacheName = 'tether_source_cache-v2'; | ||
const precacheResources = [ | ||
'/', | ||
'/offline.html', | ||
'/fonts/Quantico400.woff2', | ||
'/fonts/Quantico700.woff2', | ||
'/fonts/Tulpen-One400.woff2', | ||
'/icons/favicon.ico', | ||
'/libs/font-awesome.min.css', | ||
'/libs/fontawesome-webfont.woff' | ||
]; | ||
|
||
// When the service worker is installing, open the cache and add the precache resources to it | ||
self.addEventListener('install', (event) => { | ||
console.log('Service worker install event!'); | ||
event.waitUntil(caches.open(cacheName).then((cache) => cache.addAll(precacheResources))); | ||
}); | ||
|
||
self.addEventListener('activate', (event) => { | ||
console.log('Service worker activate event!'); | ||
}); | ||
|
||
// When there's an incoming fetch request, try and respond with a precached resource, otherwise fall back to the network | ||
self.addEventListener('fetch', (event) => { | ||
console.log('Fetch intercepted for:', event.request.url); | ||
event.respondWith( | ||
caches.match(event.request).then((cachedResponse) => { | ||
if (cachedResponse) { | ||
return cachedResponse; | ||
} | ||
return fetch(event.request); | ||
}), | ||
); | ||
}); |
File renamed without changes.