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

@WebReflection 

> The main misunderstanding I see in your code is that you used ifCanceled as if it's an onCanceled or an onRejected but actually the cancelability should be provided as callback

I understood. It's the same as the `onCancel` in my proposal, except you've put the callback in a much better place. I just wanted to see the order of events even if `resolve` was called after cancel.

> Again, the key here is backward compatible, and the third argument is not the one that resolves or reject

Yeah, I'm increasingly convinced that `.then(… onCancelled)` is a bad idea due to `async`/`await`, hanging is bad for the same reason. I don't think resolving with `undefined` is useful, as that's likely to break code expecting a particular value. Maybe rejecting with `undefined` is better (and have that hit each promise down the chain)?

I still like the ref-counting though, as a way to ensure a child cannot break an independent branch of the promise chain. 

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

Received on Monday, 30 March 2015 11:11:53 UTC