Support () => {}() syntax?

Tab Atkins Jr. jackalmage at gmail.com
Fri Sep 30 18:59:28 UTC 2016


On Fri, Sep 30, 2016 at 7:23 AM, Allen Wirfs-Brock
<allen at wirfs-brock.com> wrote:
> On Sep 30, 2016 6:10 AM, Kevin Smith <zenparsing at gmail.com> wrote:
>> Ideally there will be an `async` version of do expressions, which evaluate
>> to a promise:
>>
>> ```
>> let promise = async do {
>>   await something();
>> };
>> ```
>>
>> (BTW, if we get such a thing, we might not really need
>> top-level-module-await...)
>
> +1 !!

Aw dang, yeah, I really like that. (Obviously the example given is
trivial, as just calling something() directly would give the exact
same result, but being able to do more complicated stuff with the
result means inline promise-chaining without having to asyncify your
whole function!)

~TJ


More information about the es-discuss mailing list