- From: Jake Archibald <notifications@github.com>
- Date: Thu, 16 Apr 2015 07:25:49 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
Received on Thursday, 16 April 2015 14:26:25 UTC
@WebReflection > How is that since nobody using Promises these days would pass a third callback + nobody believes it's possible to cancel them? Consider: ```js var getValue = (_ => { var p; return _ => { if (!p) { p = new Promise(r => setTimeout(r, 5000)).then(_ => "Hello world"); } return p; } }()); var p1 = getValue(); p1.cancel(); var p2 = getValue().then(v => console.log(v)); ``` `p1` is cancelled, but that means `p2` is also cancelled. Without cancellation, `p2` would always successfully resolve. Introducing this change directly to `Promise` feels a bit dangerous. --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/fetch/issues/27#issuecomment-93747711
Received on Thursday, 16 April 2015 14:26:25 UTC