Created
July 31, 2019 18:35
-
-
Save FezVrasta/c6f4e1d1235c7c2c6349b557509b3ee3 to your computer and use it in GitHub Desktop.
This file contains 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
function registerValidSW(swUrl, config) { | |
navigator.serviceWorker | |
.register(swUrl) | |
.then(registration => { | |
// WE ADD THE CODE BELOW | |
if (registration.waiting) { | |
if (config && config.onWaiting) { | |
config.onWaiting(registration.waiting); | |
} | |
} | |
[...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment