5 ms·
Class static blocks are weird. Give me async constructors already!
by tnzm 5y ago
Class static blocks are weird. Give me async constructors already!
- k4rli 5y agoWhy would you need that?
- tnzm 5y agoWhy not?
- jakelazaroff 5y agoCan you not just define an async static function that returns an instance?
- tnzm 5y agoI can, but that's ugly - it violates standard semantics and generally introduces a new thing to know about.
- bricss 5y agoYou can simply return promise from constructor \m/