- From: Kyle Simpson <notifications@github.com>
- Date: Wed, 25 Jan 2017 05:33:00 -0800
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/fetch/issues/447/275108433@github.com>
Ahh, the subclassed-promise approach. I read about that earlier in this thread, and it doesn't seem to satisfy the original concerns (from the other thread) that people will share that promise (which has a `cancel()` on it) and thus share (perhaps accidentally) the cancelation capability in a way that will create surprising action-at-a-distance -- that is, that 3 different consumers of the same promise can be affected by only one of them deciding to cancel it. Promises are already strongly established in developer habits, especially with respect to sharing promises directly and liberally, so I see this is a common and likely scenario. If you have a controller with a promise+cancel on it, and people share the controller, this same action-a-distance *can* happen. But I think this is less likely to accidentally occur because this new controller object wouldn't be a promise itself and thus wouldn't have any precedent around liberal sharing -- it wouldn't automatically be recognizable as a thenable, wouldn't be usable with `await`, etc. It seems like people would be more likely to only share the `.pr` from the controller rather than sharing the controller itself, thus reducing the chances of accidentally sharing the cancelation capability. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/fetch/issues/447#issuecomment-275108433
Received on Wednesday, 25 January 2017 13:34:05 UTC