A Byte of Typescript

A Byte of Typescript Posts

Template String Types as Discriminants in Typescript 4.5

Template String Types as Discriminants in Typescript 4.5

In this article, we are going to explore Typescripts 4.5 feature - Template String Types as Discriminants using rudimentary examples. ...

A Byte of Typescript
Nov 17, 2021
Better Types using Discriminated Unions in TypeScript

Better Types using Discriminated Unions in TypeScript

In this article, we are going to look at how we can use discriminative unions to write better and more specific types and help typescript to be more h ...

A Byte of Typescript
Sep 26, 2021
Custom Type Guards in Typescript

Custom Type Guards in Typescript

In this article, we are going to look at how we can create our own custom type guards. Custom type guards will help you to check if a variable is of a ...

A Byte of Typescript
Sep 15, 2021
Typescript: why you should use unknown instead of any

Typescript: why you should use unknown instead of any

The unknown type, when assigned to a variable, means that a variable type is not known. And typescript doesn't allow you to use a variable of unknown ...

A Byte of Typescript
Sep 1, 2021
Type Narrowing in TypeScript

Type Narrowing in TypeScript

In this article, we are going to learn various ways you can narrow types. Type narrowing is the process of moving a type from a less process type to a ...

A Byte of Typescript
Aug 25, 2021
Template Literal Types in TypeScript

Template Literal Types in TypeScript

In this article, we will take a closer look at template literal types and how you can take advantage of them in your day to day activities as a develo ...

Typescript
Jun 23, 2021
Types and Mocking - Typescript

Types and Mocking - Typescript

Learn how to create functions which are easy to create mocks for using TypeScript utility types. ...

Typescript
Jun 7, 2021
Transforming Types in TypeScript with Utility Types

Transforming Types in TypeScript with Utility Types

In this article, we are going to have a look at these built-in utility types and a third-party library (with examples) that offers more utilities you ...

Typescript
May 5, 2021