@appsaloon/pwa-check-update
v1.0.0
Published
compares cache with latest resource on server to see if the app needs to refresh
Downloads
3
Readme
Usage
- import
- then call with a callback
- callback will be called whenever there is a new version available on the server
import pwaCheckUpdate from '@appsaloon/pwa-check-update'
pwaCheckUpdate({
onUpdateIsAvailable () {
window.alert('There is a new version available')
}
})
This package uses etag
to compare versions. You'll have to add this to your server.
If you're using serve
:
The serve
package has this feature built in, you should verify to make sure your config is correct.
This package uses the index file /
to compare versions: fetch('/', { method: 'HEAD' })