Re:When to Use TypeScript – A Detailed Guide Through Common ...
by hombre_fatal on Sunday April 07, 2019 @09:55PM
(#19601316)
Yeah, it's a strength in my book. Node makes it trivial to sequence asynchronous tasks, stuff you may be juggling in a server route.
You can start this promise early, await two parallel DB request + one API request, branch off some more async work depending on a response, await that initial promise that had a head-start because now you actually need it, and then run 10 tasks with no more than 3 in-flight at a given moment. And the code would look exactly how I just described it. And it's ubiquitous.
It's a good tool in the belt and imo the most trivial async implementation out there.
Actually, async-await is a nice feature of the JS paradigm that simplifies things and that I miss in the threaded world of Java.
But yes - use TS where you would have used JS, but TS up against other, more classical languages may not be the right choice for a lot of non-web projects.