Skip to content

Instantly share code, notes, and snippets.

@oahehc
Created September 30, 2020 03:42
Show Gist options
  • Save oahehc/47652fbc0730cc1a29fefa72ad1ef39c to your computer and use it in GitHub Desktop.
Save oahehc/47652fbc0730cc1a29fefa72ad1ef39c to your computer and use it in GitHub Desktop.
self.addEventListener("updatefound", () => {
if (reg.installing) {
reg.installing.addEventListener("statechange", () => {
if (worker.state == "installed") {
// display a message to tell our users that
// there's a new service worker is installed
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment