ON THE PAGE
navigator.serviceWorker.ready.then(function(reg) {
reg.sync.register('back-online');
});
01.
02.
03.
@philnash
Slide 40
Slide 40 text
IN THE SERVICE WORKER
self.addEventListener('sync', function(event) {
if (event.tag === 'back-online') {
// do something
}
});
01.
02.
03.
04.
05.
@philnash
IN THE SERVICE WORKER
self.addEventListener('periodicsync', function(event) {
if (event.tag === 'get-latest-news') {
// get the latest news!
}
});
01.
02.
03.
04.
05.
@philnash
Slide 46
Slide 46 text
DEMO
Slide 47
Slide 47 text
BLOG POST
http:/
/bit.ly/bg-sync
@philnash
Slide 48
Slide 48 text
THANKS
Slide 49
Slide 49 text
ICON CREDITS
• Browser by Kimmi Studio from the Noun Project
• Cloud by Kimmi Studio from the Noun Project
• Gears by TS Graphics from the Noun Project
• Database by Yo! Baba from the Noun Project
• wifi by i cons from the Noun Project
@philnash