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

> That's not the use case you describe in the comment you linked to though - it fixes that.

@benjamingr It absolutely is, and it doesn't fix it. I must not have communicated well in https://github.com/whatwg/fetch/issues/27#issuecomment-176472760. Let me try again:

```js
let operations = Promise.resolve();

function chain(func) {
  let p = operations.then(() => func());
  operations = p.catch(() => {});
  return p;
};

let someCleanup = () => { /* doesn't matter what */ };
let fooImpl = x => new Promise(resolve => setTimeout(resolve, x));

let foo = x => chain(() => fooImpl(x)).then(() => someCleanup());

let p = foo(3000).then(() => console.log("here")).catch(e => console.error(e));
p.cancel();
```

Here one would expect `fooImpl` to get cancelled, but it wont be with disinterest semantics.
Again, the real code is [here](http://mxr.mozilla.org/mozilla-central/source/dom/media/PeerConnection.js?rev=d2c568567473#488) (`someCleanup` = `legacyCatch`).

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

Received on Tuesday, 2 February 2016 16:09:13 UTC