Skip to content

Commit c2eddf4

Browse files
authoredNov 6, 2020
Mark BackgroundSyncPlugin options param as optional (#2656)
* Mark options param optional * BroadcastUpdatePlugin options
1 parent df93286 commit c2eddf4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎packages/workbox-background-sync/src/BackgroundSyncPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class BackgroundSyncPlugin implements WorkboxPlugin {
2626
* [Queue]{@link module:workbox-background-sync.Queue} documentation for
2727
* parameter details.
2828
*/
29-
constructor(name: string, options: QueueOptions) {
29+
constructor(name: string, options?: QueueOptions) {
3030
this._queue = new Queue(name, options);
3131
}
3232

‎packages/workbox-broadcast-update/src/BroadcastCacheUpdate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class BroadcastCacheUpdate {
6262
* Construct a BroadcastCacheUpdate instance with a specific `channelName` to
6363
* broadcast messages on
6464
*
65-
* @param {Object} options
65+
* @param {Object} [options]
6666
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']]
6767
* A list of headers that will be used to determine whether the responses
6868
* differ.

‎packages/workbox-broadcast-update/src/BroadcastUpdatePlugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class BroadcastUpdatePlugin implements WorkboxPlugin {
2727
* calls its [`notifyIfUpdated()`]{@link module:workbox-broadcast-update.BroadcastCacheUpdate~notifyIfUpdated}
2828
* method whenever the plugin's `cacheDidUpdate` callback is invoked.
2929
*
30-
* @param {Object} options
30+
* @param {Object} [options]
3131
* @param {Array<string>} [options.headersToCheck=['content-length', 'etag', 'last-modified']]
3232
* A list of headers that will be used to determine whether the responses
3333
* differ.
3434
* @param {string} [options.generatePayload] A function whose return value
3535
* will be used as the `payload` field in any cache update messages sent
3636
* to the window clients.
3737
*/
38-
constructor(options: BroadcastCacheUpdateOptions) {
38+
constructor(options?: BroadcastCacheUpdateOptions) {
3939
this._broadcastUpdate = new BroadcastCacheUpdate(options);
4040
}
4141

0 commit comments

Comments
 (0)
Please sign in to comment.