- From: Domenic Denicola <notifications@github.com>
- Date: Thu, 06 Apr 2017 07:34:21 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/pull/434/review/31330844@github.com>
domenic commented on this pull request. > @@ -1419,6 +1419,103 @@ that gave folks all the wrong ideas. <a>Events</a> do not represent or cause act can only be used to influence an ongoing one. +<h3 id=controlling-promises>Controlling {{Promise}}s</h3> + +Though {{Promise}} objects don't have any built-in cancellation mechanism, many {{Promise}}-vending +APIs require cancellation semantics. {{PromiseController}} is meant to support these requirements by +providing an {{PromiseController/abort()}} method that toggles the state of a corresponding +{{PromiseSignal}} object. The API which wishes to support cancellation can accept such a +{{PromiseSignal}}, and use its state to determine how (not) to proceed. + +Upon {{PromiseController/abort()}}, the relevant {{Promise}} will reject with an +<dfn exception>AbortError</dfn> [=simple exception=]. I'm not sure if we have a middle ground between "use DOMException" and "write an ES-style spec". I guess the ES-style spec could be small though, basically just saying that it fulfills the [_NativeError_ Object Structure](https://tc39.github.io/ecma262/#sec-nativeerror-object-structure) with name X. -- 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/dom/pull/434#discussion_r110177751
Received on Thursday, 6 April 2017 14:35:18 UTC