Item 7: Think of Types as Sets of Values
Effective TypeScript Blog
by
6M ago
is nearly 400 pages long, but I've received the most feedback by far on just one passage. It comes in and test them out with a few types. See if you can build that intuition for why they hold. I'll explain these equations in a moment. But before I do, head over to the ..read more
Visit website
Buy it today!
Effective TypeScript Blog
by
6M ago
If you're interested in a TypeScript book talk at your company, please reach out via guides you through 83 specific ways to improve your use of TypeScript, following the format popularized by . The second edition is thoroughly revised and updated to reflect the way that TypeScript is used 2024. to see all of the code snippets from the book in one place. You can also ..read more
Visit website
Item 36: Use a Distinct Type for Special Values
Effective TypeScript Blog
by
9M ago
It's tempting to use as special values: an empty string might represent text that hasn't loaded yet, or could stand in for a missing number. In TypeScript, this is almost always a bad idea. Special values need to be handled specially, and giving them a distinct type, such as , allows TypeScript to enforce that you do so ..read more
Visit website
Flow Nodes: How Type Inference Is Implemented
Effective TypeScript Blog
by
10M ago
If a variable gets a type but no one looks at it, does it really get a type at all? This post looks at how type inference is implemented in the TypeScript compiler. It's of some interest to anyone who uses TypeScript and is curious how it works, but it will be most relevant to developers who want to contribute to TypeScript itself ..read more
Visit website
The Making of a TypeScript Feature: Inferring Type Predicates
Effective TypeScript Blog
by
10M ago
Over the past few months I became a TypeScript contributor and implemented a new feature, , that should be one of the headliners for TypeScript 5.5. This post tells the story of how that happened: why I wanted to contribute to TypeScript, the journey to implementing the feature and getting merged, and what I've learned along the way. This is not a short read, but it will give you a good sense of what it's like to become a TypeScript contributor and develop a new feature ..read more
Visit website
Now Available: Effective TypeScript, Second Edition
Effective TypeScript Blog
by
10M ago
Fully updated, thoroughly revised, now with 50% more book ..read more
Visit website
Don't Write Traditional Getter and Setter Methods in JavaScript and TypeScript
Effective TypeScript Blog
by
1y ago
Sun 31 December 2023 ) are common in Java and considered a best practice. But they're a code smell that's best avoided in JavaScript and TypeScript because the problem they solve in Java does not exist in JS/TS. This post looks at what that problem is and how you can solve it in TypeScript without imposing the boilerplate of getters and setters ..read more
Visit website
Effective TypeScript Talk at Etsy (Dec 2020)
Effective TypeScript Blog
by
1y ago
Back in 2020 I gave a whole series of talks at companies that were interested in the language and the book. The talk that I gave at Etsy in December of 2020 was one of the most fun. It was recorded and is now available to watch. It's about an hour ..read more
Visit website
The Hidden Side of Type Predicates
Effective TypeScript Blog
by
1y ago
Type guards are a powerful tool for improving TypeScript's built-in control flow analysis. This post looks at when it's appropriate to use a type predicate, and in particular what it means when a type predicate returns ..read more
Visit website
Know How to Iterate Over Objects
Effective TypeScript Blog
by
1y ago
Use Source Maps to Debug TypeScript ..read more
Visit website

Follow Effective TypeScript Blog on FeedSpot

Continue with Google
Continue with Apple
OR