Skip to content

Instantly share code, notes, and snippets.

View gauntface's full-sized avatar
🤓
Mon-Fri: Working. Sat-Sun: Not Working.

Matt Gaunt-Seo gauntface

🤓
Mon-Fri: Working. Sat-Sun: Not Working.
View GitHub Profile
@gauntface
gauntface / sw.js
Created January 6, 2020 04:42
Trying to debug sw
function tryCache(event) {
console.log('Got request: ', event.request);
return caches.match(event.request)
.then((response) => {
if (response) {
console.log("Cache hit ", response);
return response;
}
if (process.env.NODE_ENV !== 'production')
if (this.checkEntryRevisioning === true) {
showWarningsIfNeeded(userEntries);
}
}
if (process.env.NODE_ENV !== 'production' && this.checkEntryRevisioning === true) {
showWarningsIfNeeded(userEntries);
}
# Misc Addons/Configs
dist: trusty
sudo: required
addons:
apt:
sources:
- google-chrome
- ubuntu-toolchain-r-test
packages:
- google-chrome-stable
import Route from 'workbox-routing/Route';
import {Route} from 'workbox-routing';
@gauntface
gauntface / module.js
Created July 19, 2017 15:01
Example of a module exporting everything
import Router from './lib/Router';
import Route from './lib/Route';
import ExpressRoute from './lib/ExpressRoute';
export {
Router,
Route,
ExpressRoute
}
export default new Router();
@gauntface
gauntface / module.js
Created July 19, 2017 00:20
Example of workbox-routing module.js
import Router from './lib/Router';
export default new Router();
@gauntface
gauntface / example-routing-sw.js
Created July 19, 2017 00:06
Example usage of workbox-routing global namespace
const router = new google.workbox.routing.Router();
const route = new google.workbox.routing.Route();
const expressRoute = new google.workbox.routing.ExpressRoute();
google.workbox.routing.default // This is the default export "routing"
@gauntface
gauntface / umd.js
Created July 19, 2017 00:02
An example workbox-routing/umd.js file.
import Router from './lib/Router';
import Route from './lib/Route';
import ExpressRoute from './lib/ExpressRoute';
import routing from './module.js';
export {
Router,
Route,
ExpressRoute
}