Re: [ServiceWorker] setTimeout/setInterval are unreliable in ServiceWorkers (#838)

Richard, wrapping the setTimeout() in a promise is good, but you are missing the waitUntil().  Something like:

```
addEventListener('install', function(evt) {
  evt.waitUntil(wait(1000).then(function() {
    // do delayed stuff
  })):
}):
```

Implementing any kind of implied keep-alive state is problematic and prone to abuse.  That's why we offer the explicit waitUntil().

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/838#issuecomment-188270943

Received on Wednesday, 24 February 2016 14:10:57 UTC