Proposal: Promise.prototype.Finally

2014-08-18 Thread Ron Buckton
I created the following gist as a proposal for the addition of a `finally` method to the prototype of the Promise constructor, either for ES6 (if such a thing is considered valuable and could be fast tracked at this date), or for ES7. This method would take in a single callback that would be

RE: Proposal: Promise.prototype.Finally

2014-08-18 Thread Domenic Denicola
Here is the current design for Promise.prototype.finally. I agree it is a useful feature. https://github.com/domenic/promises-unwrapping/issues/18 ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Proposal: Promise.prototype.Finally

2014-08-18 Thread David Bruant
Yes. Needed it recently. Ended up doing .then(f).catch(f) which can be survived but feels stupid. David Le 18/08/2014 21:20, Domenic Denicola a écrit : Here is the current design for Promise.prototype.finally. I agree it is a useful feature.

Re: Proposal: Promise.prototype.Finally

2014-08-18 Thread Tab Atkins Jr.
On Mon, Aug 18, 2014 at 12:30 PM, David Bruant bruan...@gmail.com wrote: Yes. Needed it recently. Ended up doing .then(f).catch(f) which can be survived but feels stupid. And doesn't have the correct pass-through behavior, unless you've got a switch in f that makes it return or throw based on

RE: Proposal: Promise.prototype.Finally

2014-08-18 Thread Ron Buckton
From: Domenic Denicola dome...@domenicdenicola.com Sent: Monday, August 18, 2014 3:20 PM To: Ron Buckton; EcmaScript Subject: RE: Proposal: Promise.prototype.Finally Here is the current design for Promise.prototype.finally. I agree it is a useful feature. https://github.com/domenic

RE: Proposal: Promise.prototype.Finally

2014-08-18 Thread Domenic Denicola
Is the consensus that this won't make it into Promise until at least ES7, and then only if there's enough of a call for it? Although I find the arbitrary division of features into ES6 and ES7 distasteful personally: yes, ES6 will not be adding new APIs. That doesn't mean that