Tags

Posts filtered by the tag typescript

  • TS Basic: Typing Errors in Try-Catch

    March 24, 2025

    Sometimes you don’t really know what error your backend or API is providing so Typescript will question the type on your try...catch block your using so this are the different types you can use.

  • TS Basic: Utilities

    March 19, 2025

    Type utilities you can use to transform types or make them more reusable. These are set of built-in generic types.

  • TS Basic: Narrowing

    February 26, 2025

    Narrowing refers to the process of refining the type of a variable or expression based on certain condition. It’s allow us to filter more specific assertions about the type of a value enabling better type checking.

  • TS Basic: Type VS Interface

    September 19, 2024

    When do we use type vs interface? Which should we use? When do we use type and interface? And why I’m starting my post like this? I read too many self-help books I guess.

  • TS Basic: Typing Promises and Async Request

    September 13, 2024

    What if our data is coming from an API? How do we ensure we have type-safe on our `async` function data?

  • TS for React: Prop Types

    October 21, 2023

    Here are some basic type and useful prop types when using Typescript in React.

  • TS Basic: Literal Types

    August 20, 2023

    Literal Types allow you to SPECIFY that a variable or parameter MUST HAVE A PARTICULAR value

  • TS Basic: Type Assertion

    August 10, 2023

    Sometimes you will have information about the type of value that TS can’t know about. Type assertions are used to explicitly specify the type of a value when the TS compiler is unable to infer it automatically.

  • TS Basic: Interfaces

    July 25, 2023

    Interface declaration is another way to name an object type.

  • TS Basic: Type Aliases

    July 22, 2023

    Type aliases are a way of creating a custom name for your type variables, functions and objects for reusability and readability.