monadic extension to do-notation

/#!/JoePea joe at trusktr.io
Wed Feb 10 06:39:36 UTC 2016


On Tue, Feb 9, 2016 at 10:28 PM, Isiah Meadows <isiahmeadows at gmail.com> wrote:
> let finalPromise = (async () => {
>   let x = await promiseA
>   let y = await promiseB
>   let c = f(a, b)
>   return g(a, b, c)
> })()

I think it's important to keep the async/await keywords because they
give a more readable semantic description of what's happening. What
about `async do`?

```javascript
let finalPromise = async do {
    let a = await promiseA
    let b = await promiseB
    let c = f(a, b)
    g(a, b, c)
}
```

That reads better!


More information about the es-discuss mailing list