Reselect is a key component of any architecture utilizing the Redux pattern. It plays a big role in delivering the right data to each component as well as helping inform React when to re-render. So it’s crucial that the selectors are efficient, only recomputing on actions that produce a new result.
Unfortunately, it’s incredibly easy to make simple mistakes that can result in unnecessary redraws in your application. In this article, I’ll go over some of these common issues and how you should design your selectors for maximum efficiency.
To understand how to make good selectors it’s critical to deeply…
Something I believe should be more clearly spelled out in the Typescript documentation is how the
extends option in the
tsconfig.json file handles overrides. One aspect that cost me more hours than I care to admit is parameters like
files are not merged, but instead overwritten by child configurations.
For more context about the Typescript team’s decision, see this github issue
In many cases, this behavior isn’t really a problem, as overwriting a simple property like
strict is likely what you want. However, if the property is something like an array, this can be pretty limiting. In my…
If you’re learning Japanese, you may have seen that it’s a good idea to incorporate reading in your practice. Seems straightforward enough, just pick a book and dive in, but the traditional method of reading a book with just a dictionary is really only suitable for the most dedicated. Fortunately, there is an easier way that I wish I knew of when I first started reading Japanese material. So whether you’re just getting ready to read your first book or just looking for tips, this guide should provide some help.
This may dash some hopes of immediately collecting a nice…
In the previous article we covered essential and derived state, but now it’s time to talk about how that state comes into the application. So in this article, I will give an introduction to side-effects, the interactions that affect state outside our application. In addition to providing examples, we’ll discuss trade-offs in different implementations.
There is a very formal definition of a side-effect, but maybe some examples would be easier to digest. A really common one in-browser applications would be making HTTP calls to external web services. Such a call can result in new information being brought in directly (e.g…
In the second article of this series (click here to read part 1), I’m going to introduce the two types of state that exist in all user interface (UI) applications. The first is “essential” state, original information that cannot be calculated (i.e. a person’s birthday). The second is “derived”, information that can be calculated (i.e. a person’s age). While simple and seemingly similar concepts, they should be handled quite differently in code.
I’ll guide you through a simple example outlining the differences, and illustrate why it is so important to implement derived state with a separate pattern. …
In this introduction, I’ll be going over the definition of state management and how it relates to…
Software engineer with over 15 years of experience. Passionate about frontend state management and static typing, but also write about my other interests.