Reduce bugs, write more explicit and understandable code, and stop reinventing the wheel using these advanced tips.
If you already know these, then congrats! You’re a TS Legend — maybe share some of your wisdom with me in the comments ( and read my other article with 5 seperate tips!).
Here’s 5 advanced TypeScript tips that will allow you to write better TypeScript Code.
Swagger is really, really helpful to see what the backend is going to serve you — but, more often than not, programmers are given bad or inconsistant API’s to use, where properties may or may not exist or different objects are returned depending on status.
Unfortunately, there’s no way to catch these at compile time if you don’t know what might come out of the API, but we can make it easy to handle (and report!) at runtime.
API’s are often an entrypoint for errors for typescript — API call results are usually casted like the following:
const myApiResult = await callApi("url.com/endpoint") as IApiResult
or even worse…
const myApiResult = await callApi("url.com/endpoint") as any
Functional Programming: Exploring the Functor type class and its use cases
This article will introduce the concepts and topics common to all programming languages, that beginners and experts must know!
Basic TypeScript types that developers need to know when working with TypeScript. In this post, we'll Learn about TypeScript Types in Programming