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

> as that's likely to break code expecting a particular value.

here's the catch: the code that is expecting a value will never be executed once the promise is canceled. It will be silently resolved and ignored for that "predefined time-lapse" that will be resolved and never executed.

Rejecting in my opinion does not really reflect the nature of cancel/ignore intent, but if that's the road then my code becomes way simpler.

Also, rejecting without a reason might be indeed a similar indication that it wasn't a real error but something "ignorable"

Last on ref counting, there's no way my code won't resolve and having silent resolution kinda ensures non breaking branches.

However, since the root is only yes/no and quantum cancel state is not easy to integrate on top of these basis, I start thinking that rejecting might be a better approach.

I might write a different snippet based on such behavior and see how it goes, I still believe the callback to define how to cancel should be private, optional, and eventually defined at Promise initialization time.

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

Received on Monday, 30 March 2015 11:21:24 UTC