Blog

  • Error Handling for fetch in TypeScript

    Introduction

    The following post describes why and how you do error handling for fetch.

    Why Care?

    When you write code that does not handle errors, the code may break at runtime and when deployed to production. Getting PagerDuty calls at 3am are not fun, and are hard to debug because you’re sleepy. Doing error handling can both prevent those early morning PageDuty alerts, as well as ensure if they do occur, you have a better indication as to what went wrong, and if you need to act on it.

    TypeScript can help you with types that make it more clear a piece of code can fail, and ensure you and other developers who build atop it months to years later also handle those errors. You just have to spend the time thinking about and writing the types.

    (more…)
  • Encoders and Decoders in TypeScript

    Encoding

    Encoding in our context means converting a type to a string so we can save it to the web browser’s local storage. In soundly typed languages, this operation will never fail, but that is not true in JavaScript which TypeScript compiles to.

    (more…)
  • First UI Story in Angular as a Functional Dev

    After 11 months, I got my 1st UI story. I’ve been doing Back-End for the Front-End stories since we’re a platform team, so 100% of the code you never visually see in the UI, but they affect how it works, so the Acceptance Tests in Cypress still have to pass.

    (more…)
  • 10 Months of Elm to Angular

    It’s been 10 months since I went from Elm to TypeScript Angular, and I still struggle with the following:

    (more…)