Futures

Juan Ignacio Dopazo dopazo.juan at gmail.com
Wed Apr 24 06:01:02 PDT 2013


2013/4/23 Ron Buckton <rbuckton at chronicles.org>

> I fall mostly under the "native futures should not implicitly chain
> library futures" camp. Its easy enough to write:
>
> var p = // some thenable
> return new Future(resolver => p.then(resolver.resolve, resolver.reject);
>

That looks terrible inefficient, so in our implementation we tried to make
chaining easier by returning a new promise from then() based on
promise.constructor. And once in the wild the issues started appearing like
someone trying to implement a LazyPromise and having issues chaining
then(). So we're considering reverting to returning a simple promise before
it becomes technical debt.

Juan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130424/5751bc88/attachment.html>


More information about the es-discuss mailing list