Skip to content

Instantly share code, notes, and snippets.

@typoerr
Created January 30, 2018 04:23
Show Gist options
  • Save typoerr/bf4cfd4c9bfbafc63406bd793de4e63b to your computer and use it in GitHub Desktop.
Save typoerr/bf4cfd4c9bfbafc63406bd793de4e63b to your computer and use it in GitHub Desktop.
// tslint:disable:no-console
(function sw(self: ServiceWorkerGlobalScope) {
self.addEventListener('install', e => {
console.log('sw:install', e)
})
self.addEventListener('activate', e => {
// e.waitUntil(self.clients.claim())
console.log('sw:activate', e)
})
self.addEventListener('message', e => {
console.log('sw:message', e)
})
})(self as any)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment