typescript

A collection of 3 post

How TypeScript guards react components

Some time ago we discussed discriminated unions as a super-feature of TypeScript which helps in keeping business rules straight in the code. Here is how we can transform this idea into React ecosystem. Let’s make sure our components are used in the right way. Unlimited variants as a highway to…

Here’s why I’m not excited about JavaScript types

A few weeks ago, the news that JavaScript would finally have its type system came like a bolt from the blue. A team whose members are, among others, responsible for creating TypeScript prepared a document proposing to introduce typing into JavaScript. The environment, excited about such a turn of…

How union let me sleep tight

Discriminated Union is my one of the most favorite mechanisms delivered by TypeScript. Maybe you are not aware, but unions are perfect for modeling business domain inside your application. In this post, I will show you, how to make your code typed stronger and more business oriented. Simple model…