News for hackers. Stuff that matters.
Re:JavaScript Structs by anon7000 on Thursday October 10, 2024 @04:06PM (#41802953)
For sure! In a basic API endpoint, I don’t need advanced typescript features.

But if I’m writing a module that a lot of other consumers in the codebase will use, and I want to make their lives easy, I might use a lot of advanced TS features to make sure than type safety & inference works perfectly within the module. Whoever consumes it can then rely on that safety, but also the convenience. The module could have some convoluted types just to provide really clean and correct auto-complete in a certain method. But most people don’t need to worry about how that works

There are no comments on this comment yet.