|
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:
850 bytes
|
| 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 | import { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';
|
|---|
| 9 | import './_version.js';
|
|---|
| 10 | /**
|
|---|
| 11 | * Define a default `handler` that's called when no routes explicitly
|
|---|
| 12 | * match the incoming request.
|
|---|
| 13 | *
|
|---|
| 14 | * Without a default handler, unmatched requests will go against the
|
|---|
| 15 | * network as if there were no service worker present.
|
|---|
| 16 | *
|
|---|
| 17 | * @param {workbox-routing~handlerCallback} handler A callback
|
|---|
| 18 | * function that returns a Promise resulting in a Response.
|
|---|
| 19 | *
|
|---|
| 20 | * @memberof workbox-routing
|
|---|
| 21 | */
|
|---|
| 22 | function setDefaultHandler(handler) {
|
|---|
| 23 | const defaultRouter = getOrCreateDefaultRouter();
|
|---|
| 24 | defaultRouter.setDefaultHandler(handler);
|
|---|
| 25 | }
|
|---|
| 26 | export { setDefaultHandler };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.