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

@riking Yes, you would.  That's the problem with Promise semantics for this use case.  The fetchPromise.then(parseResponse) call has the same effect as a fetchObservable.map(parseResponse).subscribe().  There is no way to tell a Promise you just want to map the value and that you don't care about the output yet, so you'd have to cancel all the intermediate Promises produced by the .then chain.

This is a major reason @blesh was advocating for Tasks.  They're a type with the single-valued properties of a Promise, which is certainly more appropriate here, but with separate .map and .subscribe methods like an Observable so that you can support cancellation or disinterest trivially.

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

Received on Friday, 29 January 2016 20:59:55 UTC