Styling Custom Components in React Native Using TypeScript

I recently ran into an issue with providing style properties to custom React Native components written in TypeScript. When defining the type of the style property, we were using the ViewStyle and TextStyle types provided by React Native. interface Props { textStyle?: TextStyle; viewStyle?: ViewStyle; } class BlogPost extends React.PureComponent<Props> { render() { return ( <View […]

PDF Snapshot Testing with Node and GraphicsMagick

The task I am working on this week involves generating downloadable PDF files for customer and supplier orders. We’d like to drive the implementation using tests and be able to find any regressions in the code automatically. After looking at different alternatives for accomplishing this, we decided to try a visual snapshot approach similar to […]

Experiments in Purely Functional TypeScript

Recently, I’ve been experimenting with using functional programming in my side projects. Today, I want to share some of what I’ve learned, focusing on utilities I’ve created to facilitate purely functional TypeScript programming. Different Ways to Define Similar Functions Here are three versions of *roughly* the same function: const doubleAll = (array: number[]) => { […]