Skip to content

Instantly share code, notes, and snippets.

@petebrowne
Created February 19, 2016 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petebrowne/f1451dac3f95c09d02e6 to your computer and use it in GitHub Desktop.
Save petebrowne/f1451dac3f95c09d02e6 to your computer and use it in GitHub Desktop.
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));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment