W3cubDocs

/Angular 11

SwUpdate

class

Subscribe to update notifications from the Service Worker, trigger update checks, and forcibly activate updates.

class SwUpdate {
  available: Observable<UpdateAvailableEvent>
  activated: Observable<UpdateActivatedEvent>
  unrecoverable: Observable<UnrecoverableStateEvent>
  isEnabled: boolean
  checkForUpdate(): Promise<void>
  activateUpdate(): Promise<void>
}

See also

Provided in

Properties

Property Description
available: Observable<UpdateAvailableEvent> Read-Only

Emits an UpdateAvailableEvent event whenever a new app version is available.

activated: Observable<UpdateActivatedEvent> Read-Only

Emits an UpdateActivatedEvent event whenever the app has been updated to a new version.

unrecoverable: Observable<UnrecoverableStateEvent> Read-Only

Emits an UnrecoverableStateEvent event whenever the version of the app used by the service worker to serve this client is in a broken state that cannot be recovered from without a full page reload.

isEnabled: boolean Read-Only

True if the Service Worker is enabled (supported by the browser and enabled via ServiceWorkerModule).

Methods

checkForUpdate(): Promise<void>

Parameters

There are no parameters.

Returns

Promise<void>

activateUpdate(): Promise<void>

Parameters

There are no parameters.

Returns

Promise<void>

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v11.angular.io/api/service-worker/SwUpdate