Y
Hacker News
new
|
ask
|
show
|
jobs
by
tnzm
1740 days ago
Class static blocks are weird. Give me async constructors already!
3 comments
jakelazaroff
1739 days ago
Can you not just define an async static function that returns an instance?
link
tnzm
1739 days ago
I can, but that's ugly - it violates standard semantics and generally introduces a new thing to know about.
link
bricss
1738 days ago
You can simply return promise from constructor \m/
link
k4rli
1740 days ago
Why would you need that?
link
tnzm
1739 days ago
Why not?
link