Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #2 from GoogleChrome/precache-promises
Browse files Browse the repository at this point in the history
Allow items passed to preCache to be Promises for URLs as well as just URLs
  • Loading branch information
wibblymat committed May 5, 2015
2 parents 6752ca9 + 79def66 commit 85de7e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/sw-toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ self.addEventListener('install', function(event) {
helpers.debug('preCache list: ' + (options.preCacheItems.join(', ') || '(none)'));
event.waitUntil(
helpers.openCache({cacheName: inactiveCache}).then(function(cache) {
return cache.addAll(options.preCacheItems);
return Promise.all(options.preCacheItems).then(cache.addAll.bind(cache));
})
);
});
Expand Down
4 changes: 2 additions & 2 deletions sw-toolbox.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 85de7e3

Please sign in to comment.