Re: [w3c/ServiceWorker] Improve handling of extend lifetime promises (#1049)

@jungkees yeah, I see. I think that is a bad design and if you want that code to work it should be coded as

```js
addEventListener('push', e => {
  let outResolve;
  let p = new Promise(resolve => { outResolve = resolve; });
  e.waitUntil(p.then(() => {
    e.waitUntil(q);
  });
  setTimeout(() => outResolve(), 1);
});
```

since then you actually "wait until" the argument (instead of "wait until-but-also-wait-an-extra-turn" the argument). But it's not a huge deal.

-- 
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/pull/1049#issuecomment-271761346

Received on Wednesday, 11 January 2017 02:34:52 UTC