SwUpdate

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

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

属性

属性说明
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.

isEnabled: boolean 只读

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

方法

checkForUpdate(): Promise<void>
      
      checkForUpdate(): Promise<void>
    
参数

没有参数。

返回值

Promise<void>

activateUpdate(): Promise<void>
      
      activateUpdate(): Promise<void>
    
参数

没有参数。

返回值

Promise<void>