October 2017
Intermediate to advanced
302 pages
7h 27m
English
Again, we have to do an event.waitUntil() while we complete this async code. This means we'll have to eventually return a Promise to the event.waitUntil(), which will affect how we write our code.
First, we grab the list of cache keys, by calling cache.keys(), which returns a promise:
self.addEventListener('activate', event => { event.waitUntil( cache.keys().then(keyList => { }) );});
Read now
Unlock full access