Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tnzm
· 5y ago · 0 comments
Class static blocks are weird. Give me async constructors already!
Comments
[–]
jakelazaroff
5y ago
Can you not just define an async static function that returns an instance?
[–]
tnzm
OP
5y ago
I can, but that's ugly - it violates standard semantics and generally introduces a new thing to know about.
[–]
bricss
5y ago
You can simply return promise from constructor \m/
[–]
k4rli
5y ago
Why would you need that?
[–]
tnzm
OP
5y ago
Why not?