|
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.1 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 | import { logger } from './_private/logger.js';
|
|---|
| 9 | import { assert } from './_private/assert.js';
|
|---|
| 10 | import { quotaErrorCallbacks } from './models/quotaErrorCallbacks.js';
|
|---|
| 11 | import './_version.js';
|
|---|
| 12 | /**
|
|---|
| 13 | * Adds a function to the set of quotaErrorCallbacks that will be executed if
|
|---|
| 14 | * there's a quota error.
|
|---|
| 15 | *
|
|---|
| 16 | * @param {Function} callback
|
|---|
| 17 | * @memberof workbox-core
|
|---|
| 18 | */
|
|---|
| 19 | // Can't change Function type
|
|---|
| 20 | // eslint-disable-next-line @typescript-eslint/ban-types
|
|---|
| 21 | function registerQuotaErrorCallback(callback) {
|
|---|
| 22 | if (process.env.NODE_ENV !== 'production') {
|
|---|
| 23 | assert.isType(callback, 'function', {
|
|---|
| 24 | moduleName: 'workbox-core',
|
|---|
| 25 | funcName: 'register',
|
|---|
| 26 | paramName: 'callback',
|
|---|
| 27 | });
|
|---|
| 28 | }
|
|---|
| 29 | quotaErrorCallbacks.add(callback);
|
|---|
| 30 | if (process.env.NODE_ENV !== 'production') {
|
|---|
| 31 | logger.log('Registered a callback to respond to quota errors.', callback);
|
|---|
| 32 | }
|
|---|
| 33 | }
|
|---|
| 34 | export { registerQuotaErrorCallback };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.