TypeScript is a wonderful language for designing data-driven applications. The type system is suited to describe the many different shapes and transformations of data as it travels from one end of a system to another. As my team has gained more experience with TypeScript, we’ve developed some guidelines for creating typed modules that help the […]
Great apps aren’t stuck in the mud. They change with the times. They float like oak leaves along a wide river of user expectations, business requirements, fashion trends, and platform changes. To keep floating, leaves 🍂 apps need a watchful team of developers to walk the muddy banks nudging them back toward fast water whenever […]
In my last post, I showed how to write a higher-order function that could wrap an existing function without losing the original function’s types. Today, I’m going to show how you can use that same technique to wrap an existing function for a different result–to execute it in a background process using the workerpool npm […]
On a recent project, we needed to support multi-level tab bar navigation within our application. With multiple variations of tab bars, each page needed to know which tabs to show. We found that TypeScript offered a good solution.
Being explicit about the return type of the function is the most under-utilized feature of TypeScript. At least, that’s true for the way I write my code. When I first started using TypeScript, I was really impressed with the way it inferred the return type of the function, and having these types perpetuate throughout the […]
As of TypeScript 3.1, the lib.es5.d.ts file provides a couple of predefined types that are very helpful when trying to write generic higher-order functions. In this post, I’m going to show an example of using the Parameters and ReturnType predefined types for just that purpose.
On a recent project, I had a need to create an FTP connection to a third-party server. Since we had no control over the server, I also wanted to setup a test FTP server that I could use to run our client against to make sure we could connect successfully. It turned out that implementing […]
The project I’m working on has a Node.js back end written in TypeScript, with a PostgreSQL database for persistence. We had a production user who encountered an error when the system tried to insert a row into a table that had an integer column in it. The value it was trying to insert was 239.99999999999997, […]
I'm super excited to be giving a talk about TypeScript at Strange Loop this year! The talk, “Understanding TypeScript's Structural Type System,” covers some of the deeper and most exciting ideas at the heart of TypeScript's namesake feature. You can get an overview from the slides. (I'll post a link to the video once it's […]
A while ago, I was working on a project based off the Atomic SPA Starter Kit, which uses TypeScript, React, and GraphQL. One of the features we needed to build was a file upload component that supported dragging and dropping a file from a separate window onto the UI.