- From: Jake Archibald <notifications@github.com>
- Date: Thu, 17 Dec 2015 08:22:54 -0800
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
Received on Thursday, 17 December 2015 16:23:30 UTC
@jeffposnick
> there could be a new promise, perhaps named .controlled
This could be implemented as:
```js
const p = new Promise(r => {
if (navigator.serviceWorker.controller) return r();
navigator.serviceWorker.addEventListener('controllerchange', e => r());
});
```
I think we need more evidence that this is a common enough pattern to add to the platform.
---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/799#issuecomment-165499718
Received on Thursday, 17 December 2015 16:23:30 UTC