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

It's not fully specified yet so I'd say it would work similar as generators do ... you externally invoke `.next(value)` there and receive the state.

If you have an `async` function in a world where there are cancel-able promises I don't see why `foo().cancel(resolve);` shouldn't implicitly invoke internal holded `ajax(url).cancel(resolve)` too and throw if that's not cancelable since there's nothing to cancel.

My proposal works well with cancelable things if these are cancelable, otherwise it throws regardless. How to know if an API is cancelable? Same way you know you can use any method from any kind of known API/object.

About `foo().then(...).cancel(resolve);` ? Same exact thing, if you start from a cancelable Promise, all derived Promises (then/catch) are cancelable too.

I might miss something about your concern, or maybe over-simplify something I don't see as concern.

The road otherwise is to have Promises problems in ES7 too ... that does not sound brilliant to me.

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

Received on Monday, 30 March 2015 17:45:17 UTC