Created
July 31, 2019 18:36
-
-
Save FezVrasta/d7a3f6d0ecd59ef23780a1af35cda36d to your computer and use it in GitHub Desktop.
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
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