Last active
October 12, 2017 10:54
-
-
Save eezhal92/3d61ced1b4adac54957699fc3b79fc3a to your computer and use it in GitHub Desktop.
Bg Sync Demo
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 offerBgSync(err) { | |
if (!window.navigator.onLine) { | |
showBgSyncOffer(); | |
listen.approveBgSync((event) => { | |
askNotificationPermission() | |
.then(queueRecipeLoad) | |
.then(getServiceWorkerRegistration) | |
.then(registerBgSync) | |
.then(showBgSyncApproval); | |
}); | |
} | |
throw err; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment