GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • Service Worker Communication Guide
  • SwUpdate
  • VersionEvent
  • UnrecoverableStateEvent

This view

  • Original page
  • New address

GeezerVison is showing next.angular.dev — SwUpdate • Angular

API

    
      class SwUpdate {}
    
    
@paramswNgswCommChannel
@returnsSwUpdate

Emits a VersionDetectedEvent event whenever a new version is detected on the server.

Emits a VersionInstallationFailedEvent event whenever checking for or downloading a new version fails.

Emits a VersionReadyEvent event whenever a new version has been downloaded and is ready for activation.

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.

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

Checks for an update and waits until the new version is downloaded from the server and ready for activation.

@returnsPromise<boolean>

a promise that

  • resolves to true if a new version was found and is ready to be activated.
  • resolves to false if no new version was found
  • rejects if any error occurs

Updates the current client (i.e. browser tab) to the latest version that is ready for activation.

In most cases, you should not use this method and instead should update a client by reloading the page.

Updating a client without reloading can easily result in a broken application due to a version mismatch between the application shell and other page resources, such as lazy-loaded chunks, whose filenames may change between versions.

Only use this method, if you are certain it is safe for your specific use case.

@returnsPromise<boolean>

a promise that

  • resolves to true if an update was activated successfully
  • resolves to false if no update was available (for example, the client was already on the latest version).
  • rejects if any error occurs
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.