Skip to content

Instantly share code, notes, and snippets.

View mtonc's full-sized avatar

Mark Tonchick mtonc

  • Greater Chicago Area, IL
View GitHub Profile
const catchAsync = (fn) => {
try {
return async (...args) => await fn(...args);
} catch (err) {
console.error(err);
}
};
export default catchAsync;
// Core assets
let coreAssets = [];
// On install, cache core assets
self.addEventListener('install', function (event) {
// Cache core assets
event.waitUntil(caches.open('app').then(function (cache) {
for (let asset of coreAssets) {
cache.add(new Request(asset));