Re: [fetch] Add timeout option (#20)

I think the code below would be helpful.

```
var p = Promise.race([
  fetch('/resource-that-may-take-a-while'),
  new Promise(function (resolve, reject) {
    setTimeout(() => reject(new Error('request timeout')), 5000)
  })
])
p.then(response => console.log(response))
p.catch(error => console.log(error))
```

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/20#issuecomment-196113354

Received on Monday, 14 March 2016 02:40:42 UTC