填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写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>