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

@jakearchibald what is wrong with this way?
```javascript
var req = fetch('...');

// or req.headers.then(...)
req.response.then(function(response) {
  if (response.headers.get('Content-Type') !== 'aplication/json') {
    req.cancel();
  }

  return response.json();
});

req.addEventListener('cancel', function() {
  // ...
});

// or Streams-style way
// closed/cancelled/aborted
req.closed.then(function() {
  // ...
});
```

Here ```fetch``` will return some FetchObject, not Promise itself.


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

Received on Friday, 27 March 2015 15:33:42 UTC