|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
542 bytes
|
| Line | |
|---|
| 1 | import './_version.js';
|
|---|
| 2 | /**
|
|---|
| 3 | * @memberof workbox-recipes
|
|---|
| 4 |
|
|---|
| 5 | * @param {Object} options
|
|---|
| 6 | * @param {string[]} options.urls Paths to warm the strategy's cache with
|
|---|
| 7 | * @param {Strategy} options.strategy Strategy to use
|
|---|
| 8 | */
|
|---|
| 9 | function warmStrategyCache(options) {
|
|---|
| 10 | self.addEventListener('install', (event) => {
|
|---|
| 11 | const done = options.urls.map((path) => options.strategy.handleAll({
|
|---|
| 12 | event,
|
|---|
| 13 | request: new Request(path),
|
|---|
| 14 | })[1]);
|
|---|
| 15 | event.waitUntil(Promise.all(done));
|
|---|
| 16 | });
|
|---|
| 17 | }
|
|---|
| 18 | export { warmStrategyCache };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.