π¨βπ« Co-Founder of This is Learning, Organizer of AarhusJS
βοΈ Writer, Speaker, FOSS Maintainer π Author
π Microsoft MVP π GitHub Star
π Nx Champion π¦Έ Angular Hero of Education
π¨βπ« Co-Founder of This is Learning, Organizer of AarhusJS
βοΈ Writer, Speaker, FOSS Maintainer π Author
π Microsoft MVP π GitHub Star
π Nx Champion π¦Έ Angular Hero of Education
Nice example! Probably, I would have used async await constructor to avoid callbacks.
Client-side application frameworks usually have an initialization hook which I why I used this example.
Starting side effects on a constructor is also considered poor design.
Iβm sorry. I was not clear.
What I meant to say itβs to use the async await syntax instead of cascading βthenβ.
developer.mozilla.org/en-US/docs/W...
The class constructor has nothing to do with this.
Using async-await is largely a preference. If we us it, we have to wrap most calls in try-catch.