register-service-worker
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -57,3 +57,3 @@ // Register a service worker to serve assets from local cache. | ||
// available; please refresh." message in your web app. | ||
emit('updated') | ||
emit('updated', registration) | ||
} else { | ||
@@ -63,3 +63,3 @@ // At this point, everything has been precached. | ||
// "Content is cached for offline use." message. | ||
emit('cached') | ||
emit('cached', registration) | ||
} | ||
@@ -66,0 +66,0 @@ } |
{ | ||
"name": "register-service-worker", | ||
"sideEffects": false, | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Script for registering service worker, with hooks", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -16,6 +16,6 @@ # register-service-worker | ||
}, | ||
cached () { | ||
cached (registration) { | ||
console.log('Content has been cached for offline use.') | ||
}, | ||
updated () { | ||
updated (registration) { | ||
console.log('New content is available; please refresh.') | ||
@@ -31,1 +31,3 @@ }, | ||
``` | ||
The `cached` and `updated` events passes a [ServiceWorkerRegistration](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration) instance in their arguments. |
@@ -54,3 +54,3 @@ // Register a service worker to serve assets from local cache. | ||
// available; please refresh." message in your web app. | ||
emit('updated') | ||
emit('updated', registration) | ||
} else { | ||
@@ -60,3 +60,3 @@ // At this point, everything has been precached. | ||
// "Content is cached for offline use." message. | ||
emit('cached') | ||
emit('cached', registration) | ||
} | ||
@@ -63,0 +63,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12008
32