Type-Safe Object Merging (TypeScript 2.8 Edition)

There are times when you want to merge two generic types in TypeScript, and type inference just isn’t doing it for you. Object.assign’s typing isn’t as precise as it could be, and spreading generics still doesn’t work. I’ve found a way to implement typing when merging objects using some of the new features in TypeScript 2.8.

Read more on Type-Safe Object Merging (TypeScript 2.8 Edition)…

Best Practices for Solo Development

On most projects at Atomic Object, teams have at least two developers, allowing for pairing, code reviews, and other common practices we follow. On occasion, though, a smaller project needs only one developer. I’ve spent a portion of my current project working on my own and have found a few practices that make solo development easier. Read more on Best Practices for Solo Development…

Code Reviews as a Tool to Boost Productivity

Code reviews are an important part of the development process for many teams. One of the big reasons teams use them is to give reviewers the chance to identify mistakes in code before it is merged into the rest of the codebase, but they’re also a great way to share knowledge about the application with the team and boost productivity.

Read more on Code Reviews as a Tool to Boost Productivity…

React State vs. Redux State: When and Why?

Just about any app you write needs a way to manage state. Redux manages state and state transformations and is often used with React, but React has its own concept of state.

When using these libraries, it’s good to know which to use when. Even if you choose to use Redux in your project, you will still need to make decisions on how much of your data is stored in Redux. Read more on React State vs. Redux State: When and Why?…

Typesafe Container Components with React-Redux’s Connect and TypeScript

TypeScript is fantastic—you get feedback as you write your code to (mostly) ensure you’re passing valid arguments to functions and props to components. However, when using the connect function, you may find that you are permitted to pass invalid props or omit required props to components. In this post, I’ll discuss how the issue arises, and how to fix it by typing your calls to connect! Read more on Typesafe Container Components with React-Redux’s Connect and TypeScript…

Higher-Order Components in React

React emphasizes composition over inheritance, making it simple to compose larger components by reusing smaller ones. This approach is at odds with the way many programmers are accustomed to reusing code: inheritance Object-Oriented Programming (OOP).

React uses higher-order components (HoCs) as an alternative to inheritance. Similar to higher-order functions, which take or return other functions, HoCs are functions that take a component as an argument and return another component. Read more on Higher-Order Components in React…