Created
October 28, 2019 14:27
-
-
Save thepassle/3d07ebc3e1231405922cd560826b9b28 to your computer and use it in GitHub Desktop.
updating6
This file contains hidden or 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
const reg = await navigator.serviceWorker.getRegistration(); | |
reg.addEventListener('updatefound', () => { | |
const newWorker = reg.installing; | |
newWorker.addEventListener('statechange', () => { | |
if (newWorker.state === 'installed') { | |
// Update available! Show an install button | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment