Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/pmb/node_modules/workbox-broadcast-update/ drwxr-xr-x | |
| Viewing file: Select action/file-type: /*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';
import { BroadcastCacheUpdate, } from './BroadcastCacheUpdate.js';
import './_version.js';
/**
* This plugin will automatically broadcast a message whenever a cached response
* is updated.
*
* @memberof workbox-broadcast-update
*/
class BroadcastUpdatePlugin {
/**
* Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with
* the passed options and calls its `notifyIfUpdated` method whenever the
* plugin's `cacheDidUpdate` callback is invoked.
*
* @param {Object} [options]
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']]
* A list of headers that will be used to determine whether the responses
* differ.
* @param {string} [options.generatePayload] A function whose return value
* will be used as the `payload` field in any cache update messages sent
* to the window clients.
*/
constructor(options) {
/**
* A "lifecycle" callback that will be triggered automatically by the
* `workbox-sw` and `workbox-runtime-caching` handlers when an entry is
* added to a cache.
*
* @private
* @param {Object} options The input object to this function.
* @param {string} options.cacheName Name of the cache being updated.
* @param {Response} [options.oldResponse] The previous cached value, if any.
* @param {Response} options.newResponse The new value in the cache.
* @param {Request} options.request The request that triggered the update.
* @param {Request} options.event The event that triggered the update.
*/
this.cacheDidUpdate = async (options) => {
dontWaitFor(this._broadcastUpdate.notifyIfUpdated(options));
};
this._broadcastUpdate = new BroadcastCacheUpdate(options);
}
}
export { BroadcastUpdatePlugin };
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0315 ]-- |