|
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:
1.2 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | Copyright 2019 Google LLC
|
|---|
| 3 |
|
|---|
| 4 | Use of this source code is governed by an MIT-style
|
|---|
| 5 | license that can be found in the LICENSE file or at
|
|---|
| 6 | https://opensource.org/licenses/MIT.
|
|---|
| 7 | */
|
|---|
| 8 |
|
|---|
| 9 | import {getOrCreatePrecacheController} from './utils/getOrCreatePrecacheController.js';
|
|---|
| 10 | import {RouteHandlerCallback} from 'workbox-core/types.js';
|
|---|
| 11 | import './_version.js';
|
|---|
| 12 |
|
|---|
| 13 | /**
|
|---|
| 14 | * Helper function that calls
|
|---|
| 15 | * {@link PrecacheController#createHandlerBoundToURL} on the default
|
|---|
| 16 | * {@link PrecacheController} instance.
|
|---|
| 17 | *
|
|---|
| 18 | * If you are creating your own {@link PrecacheController}, then call the
|
|---|
| 19 | * {@link PrecacheController#createHandlerBoundToURL} on that instance,
|
|---|
| 20 | * instead of using this function.
|
|---|
| 21 | *
|
|---|
| 22 | * @param {string} url The precached URL which will be used to lookup the
|
|---|
| 23 | * `Response`.
|
|---|
| 24 | * @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the
|
|---|
| 25 | * response from the network if there's a precache miss.
|
|---|
| 26 | * @return {workbox-routing~handlerCallback}
|
|---|
| 27 | *
|
|---|
| 28 | * @memberof workbox-precaching
|
|---|
| 29 | */
|
|---|
| 30 | function createHandlerBoundToURL(url: string): RouteHandlerCallback {
|
|---|
| 31 | const precacheController = getOrCreatePrecacheController();
|
|---|
| 32 | return precacheController.createHandlerBoundToURL(url);
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | export {createHandlerBoundToURL};
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.