Why they might compute more often than intended, and some best practices for managing more complicated scenarios

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.

The createSelector function

To understand how to make good selectors it’s critical to deeply…

A big gotcha to keep in mind for any Typescript monorepo

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 include or 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…

And why ebooks are better than paperbacks for reading practice

Kindle Paperwhite 2002” by Masaru Kamikura is licensed under CC BY 2.0

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.

Digital is the way to go

This may dash some hopes of immediately collecting a nice…

Introducing side-effects and a few example approaches to model them in Redux along with their trade-offs

Photo by Chris Ried on Unsplash

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.

What are effects?

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…

Introducing essential and derived state, and how to implement both using Redux

Photo by Markus Spiske on Unsplash

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. …

A beginner’s introduction to the world of Javascript UI state management and frameworks

This is the first in a series of posts about my philosophy around state management in Javascript User Interface (UI) applications. I want to note that I’m coming from a background having worked on some fairly large frontends, and may have some bias towards patterns that suit that situation. That doesn’t mean I want to push powerful frameworks for all situations. Far from that, I want this series to inform the reader on whether heavier frameworks are the right choice for their project.

In this introduction, I’ll be going over the definition of state management and how it relates to…

Mike Yoon

Software engineer with over 15 years of experience. Passionate about frontend state management and static typing, but also write about my other interests.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store