Re: [whatwg/fetch] Add option to reject the fetch promise automatically after a certain time elapsed (with no API for arbitrary aborts) (#179)

Something like this just better than just specifying integer for timeout parameter. Manually cancelling the request is a thing.

https://github.com/whatwg/fetch/issues/20#issuecomment-217632042

```javascript

var cancelpromise1 = new Promise(function(resolve, reject) {
     setTimeout(resolve, 1000);
});

var cancelpromise2 = /* a promise that will be resolved when user clicks cancel */;

var lastpromise = Promise.race([cancelpromise1, cancelpromise2]);

fetch(..., { timeout: lastpromise })
   ...

```

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/179#issuecomment-217632265

Received on Saturday, 7 May 2016 12:25:38 UTC