Created
August 11, 2016 16:22
-
-
Save tevko/15401c73829801874efa48892ce67abd 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
self.addEventListener('install', function(event) { | |
// Perform install steps | |
event.waitUntil( | |
caches.open(BB_SW_CACHE_NAME) | |
.then(function(cache) { | |
BB_urlsToCache.map(function(url) { | |
var request = new Request(url, {mode: 'no-cors'}); | |
fetch(request).then(function(response) { | |
return caches.open(BB_SW_CACHE_NAME).then(function(c) { | |
return c.put(request, response); | |
}) | |
}) | |
}) | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The promise for all the caching isn't being passed back to
waitUntil
, it's lost after the first.then
.