Re: Deprecating Future's .then()

Anne van Kesteren <annevk-6shE6wEKUUpmR6Xm/[email protected]>
Newsgroups gmane.comp.lang.javascript.ecmascript4.general,gmane.comp.web.dom.general
Message-ID <CADnb78gc2VAbxkvsy13YEFQWYnBvy2UTi3o5dYsHLZWGe1YNng@mail.gmail.com>
On Tue, Jun 4, 2013 at 4:32 PM, Mark S. Miller <[email protected]> wrote:
> Given this direction, I think the one operation that serves as both
> Promise.resolve and Promise.fulfill should be the previously suggested
> Promise.of.

I think you still want Promise.resolve because it makes sense with
Promise.reject and the instance methods on PromiseResolver. Promise.of
would be a good alias to have.


> I am always worried though when people use the term "unwrapping" as I
> don't know what they mean. Does this mean flattening, assimilating, both, or
> something else? What I mean here is to so one level of flattening. As for
> whether .then should also do one level of assimilation if it sees a
> non-promise thenable, I could go either way, but prefer that it should not.
> The promise-cross-thenable case should be sufficiently rare that the cost of
> the extra bookkeeping should be negligible.

Sorry for the confusion. I thought you guys had already settled on
accepting what the DOM standard currently defines (no branding checks
of any kind, just use a callable then property, if any). If that's not
the case, writing out the desired behavior for then()/flatMap() here
would help.


--
http://annevankesteren.nl/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.