Async Class

Naveen Chawla naveen.chwl at
Sat Feb 17 04:42:55 UTC 2018

You can just call an async method from the constructor (without await) -
and then let that async method handle all the asynchronicity.

Does this satisfy your use case?

I think `async constructor` would make more sense than `async class`.
Calling `new MyObjectAsync()` would have to return a promise for the
object, requiring `await` to actually get the object.

My only reservation is that it does require caution not to presume that
`new X()` isn't actually an instance of `X` (but that `await new X()` is).
Otherwise I don't mind it.

On Fri, 16 Feb 2018 at 14:14 Dimitrian Nine <dimtimeforever at>

> "It gets ugly(ier) when you want to extend that. :-) "
> Ok, i get it, but yes i prefer some more sugar like as i suggested before.
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list