Tab Atkins Jr. (2014-02-07T17:14:45.000Z)
On Fri, Feb 7, 2014 at 8:20 AM, Jonathan Bond-Caron
<jbondc at gdesolutions.com> wrote:
> On Fri Feb 7 06:50 AM, Anne van Kesteren wrote:
>> On Fri, Feb 7, 2014 at 12:45 PM, Yutaka Hirano <yhirano at chromium.org> wrote:
>> > Sorry for knowing little about ES "consensus", is this the final decision?
>> > Will you change it again?
>>
>> Yeah, some clarity would be nice.
>
> From a user perspective, can someone explain what chain() does?

.chain returns what is directly inside the promise, without doing any
additional magic.  This is different from .then, which "flattens"
promises.

For a more concrete example, assume that "x" is a
Promise<Promise<integer>>.  That is, it's a promise, holding a
promise, holding an integer.  x.chain(arg=>"arg is a
Promise<Integer>"), x.then(arg=>"arg is an Integer").

~TJ
domenic at domenicdenicola.com (2014-02-10T22:40:14.255Z)
On Fri, Feb 7, 2014 at 8:20 AM, Jonathan Bond-Caron <jbondc at gdesolutions.com> wrote:

> From a user perspective, can someone explain what chain() does?

.chain returns what is directly inside the promise, without doing any
additional magic.  This is different from .then, which "flattens"
promises.

For a more concrete example, assume that "x" is a Promise<Promise<integer>>.  That is, it's a promise, holding a promise, holding an integer.  `x.chain(arg=>"arg is a Promise<Integer>")`, `x.then(arg=>"arg is an Integer")`.