naveen.chwl at gmail.com
Sun Feb 18 08:27:19 UTC 2018
Of course if you wanted to await at the constructor call level (and await
inside the constructor itself), e.g.
const myObject = await new MyObject();
...then of course you would need the "async constructor" feature, like
you've requested, but then `new MyObject()` would return a promise.
Personally I have no problem with this:
It suffers from the same bug-set than you would get if you converted a
synchronous function to an asynchronous one (i.e. the need to await).
On Sat, 17 Feb 2018 at 11:13 Dimitrian Nine <dimtimeforever at gmail.com>
> "You can just call an async method from the constructor (without await) -
> and then let that async method handle all the asynchronicity."
> Not sure about it - how control? callback?
> I prefer async/await then.
> "I think async constructor would make more sense than async class"
> Maybe: i use it for class more for difference between class and async
> class was more visible.
> But yes in total idea about async constructor.
> Both variants work for me.
> What more useful - i dont sure...
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss