[w3c/ServiceWorker] event.waitUntil/respondWith vs return promise (#1148)

Currently SW event listeners require using `event.respondWith` and `event.waitUntil`. 

It would be nice if we could return a promise instead of these. 

The argument against [given here](https://twitter.com/pemrouz/status/849311164911824896) was that because "it lets you keep the SW alive forever". However, you could pass the promise `sleep(Infinity)` to `event.waitUntil` too, so there doesn't seem to be anything special about the `event.*` syntax over using an `async` function + `return` value. That is, the browser can kill the SW in both cases if it's taking too long. 

-- 
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/1148

Received on Saturday, 20 May 2017 21:50:03 UTC