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
npm install --save react react-dom d3-shape d3-scale |
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
function isHtmlRequest(request) { | |
return ( | |
request.method === 'GET' && | |
request.headers.get('accept').includes('text/html') | |
); | |
} | |
self.addEventListener('fetch', event => { | |
if (isHtmlRequest(event.request)) { | |
event.respondWith( |
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
var CACHE_VERSION = 1; | |
var CACHE_NAME = `example-4_${CACHE_VERSION}`; | |
var OFFLINE_URL = 'offline.html'; | |
var CACHE_URLS = [ | |
OFFLINE_URL | |
]; | |
self.addEventListener('install', event => { | |
event.waitUntil( | |
caches.open(CACHE_NAME).then(cache => { |
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
self.addEventListener('fetch', event => { | |
event.respondWith( | |
caches.match(event.request).then(response => { | |
return response || 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
var CACHE_VERSION = 1; | |
var CACHE_NAME = `example-3_${CACHE_VERSION}`; | |
var CACHE_URLS = [ | |
'site.css', | |
'site.js' | |
]; | |
self.addEventListener('install', event => { | |
event.waitUntil( | |
caches.open(CACHE_NAME).then(cache => { |
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
navigator.serviceWorker.register('service-worker.js').then(function(registration) { | |
console.log('registered!', registration) | |
}); |
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
self.addEventListener('activate', event => { | |
event.waitUntil( | |
caches.keys().then(cacheNames => { | |
return Promise.all( | |
cacheNames.map(cacheName => { | |
if (cacheName !== CACHE_NAME) { | |
console.log('Deleting out of date cache:', cacheName); | |
return caches.delete(cacheName); | |
} | |
}) |
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
self.addEventListener('fetch', event => { | |
var response = new Response('This came from the service worker!'); | |
event.respondWith(response); | |
// Default behavior - same as not using `respondWith` | |
// event.responseWith(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
console.log(self); | |
self.addEventListener('install', event => { | |
console.log('installed!', event); | |
}); | |
self.addEventListener('activate', event => { | |
console.log('activated!', event); | |
}); |
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
SELECT DISTINCT "insurance_insuranceissuer"."id", "insurance_insuranceissuer"."slug", "insurance_insuranceissuer"."issuer_code", "insurance_insuranceissuer"."legal_name", "insurance_insuranceissuer"."marketing_name", "insurance_insuranceissuer"."company_code", "insurance_insuranceissuer"."group_code", "insurance_insuranceissuer"."state", "insurance_insuranceissuer"."created_at", "insurance_insuranceissuer"."updated_at" FROM "insurance_insuranceissuer" INNER JOIN "insurance_coverage_practiceissuer" ON ( "insurance_insuranceissuer"."id" = "insurance_coverage_practiceissuer"."issuer_id" ) WHERE ("insurance_coverage_practiceissuer"."in_network" = %s AND "insurance_coverage_practiceissuer"."practice_id" = %s ) LIMIT 21' - PARAMS = (True, u'b107925f-aac8-4baa-b304-3ec720ef082d'); args=(True, u'b107925f-aac8-4baa-b304-3ec720ef082d') |