Re: [w3c/ServiceWorker] Provide a one-line way to listen for a waiting Service Worker (#1222)

@dfabulich in case you're interested, we've included this feature in the `workbox-window` library, which should be released very soon (it's currently [version 4.0.0-rc.1](https://github.com/GoogleChrome/workbox/releases/tag/v4.0.0-rc.1)).

With `workbox-window` you can listen for a waiting service worker as follows:

```js
import {Workbox} from 'workbox-window';

const wb = new Workbox('/sw.js');

wb.addEventListener('waiting', () => {
  // Do something when the SW is stuck in the waiting phase.
});

wb.register();
```

While obviously this is not as good as a native solution, hopefully it'll make it easier for developers to handle these important cases.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1222#issuecomment-463371148

Received on Wednesday, 13 February 2019 21:08:05 UTC