Skip to content

Commit

Permalink
Mark BackgroundSyncPlugin options param as optional (#2656)
Browse files Browse the repository at this point in the history
* Mark options param optional

* BroadcastUpdatePlugin options
  • Loading branch information
jeffposnick authored Nov 6, 2020
1 parent df93286 commit c2eddf4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BackgroundSyncPlugin implements WorkboxPlugin {
* [Queue]{@link module:workbox-background-sync.Queue} documentation for
* parameter details.
*/
constructor(name: string, options: QueueOptions) {
constructor(name: string, options?: QueueOptions) {
this._queue = new Queue(name, options);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class BroadcastCacheUpdate {
* Construct a BroadcastCacheUpdate instance with a specific `channelName` to
* broadcast messages on
*
* @param {Object} options
* @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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class BroadcastUpdatePlugin implements WorkboxPlugin {
* calls its [`notifyIfUpdated()`]{@link module:workbox-broadcast-update.BroadcastCacheUpdate~notifyIfUpdated}
* method whenever the plugin's `cacheDidUpdate` callback is invoked.
*
* @param {Object} options
* @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: BroadcastCacheUpdateOptions) {
constructor(options?: BroadcastCacheUpdateOptions) {
this._broadcastUpdate = new BroadcastCacheUpdate(options);
}

Expand Down

0 comments on commit c2eddf4

Please sign in to comment.