Re: [fetch] Aborting a fetch (#27)

Since calling abort might not abort the fetch (request), I don't think the method should be called `abort` (or `cancel`, as it is in some other specificatins), but rather `ignore`, since that is all it can guarantee to do. For example, 

```js
var request = fetch(url);
var json = request.then(r => r.json);
var text = request.then(r => r.text);
text.ignore(); //doesn't abort the fetch, only ignores the result.
```

This would also work well with promise implementations that don't support cancellations (like the current spec), since calling `abort` on it might not abort a promise early in the chain, but calling `ignore` will always ignore the result. For example:

```js
//doSomething does not return a cancellablePromise, so calling abort won't abort what is
//happening inside doSomething. ignore makes it clear that only the result will be ignored,
//any data done can't be guaranteed to be aborted.
doSomething().then(url => fetch(url)).then(r => r.json).ignore()
```

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

Received on Thursday, 26 March 2015 14:03:43 UTC