填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫Home

SwUpdate

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>
}
    

參見

Provided in

屬性

屬性說明
available: Observable<UpdateAvailableEvent>唯讀

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

activated: Observable<UpdateActivatedEvent>唯讀

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

unrecoverable: Observable<UnrecoverableStateEvent>唯讀

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唯讀

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

方法

      
      checkForUpdate(): Promise<void>
    
引數

沒有引數。

返回值

Promise<void>

      
      activateUpdate(): Promise<void>
    
引數

沒有引數。

返回值

Promise<void>