Category: Redux

Redux

Performant Redux Selectors with Reselect

In Redux a selector is a piece of logic that gets a specific piece of state from the store. Additionally, a selector can compute data from a given state, allowing the store to keep only basic raw data. Selectors are usually used as part of the binding between the store and the container components. In […]

Redux

Form Handling Using Redux Form

Handling the data and events related to forms and input fields in web apps is not most people’s idea of fun. Thankfully though, there are plenty of available libraries that abstract away some of the tedious work. If your React app already happens to use Redux for state management, then Redux Form is one such […]

Redux

Asynchronous Redux Actions Using Redux Thunk

By default actions in Redux are dispatched synchronously, which is a problem for any non-trivial app that needs to communicate with an external API or perform side effects. Thankfully though, Redux allows for middleware that sits between an action being dispatched and the action reaching the reducers. There are two very popular middleware libraries that […]

Redux

Higher-Order Reducers in Redux

In Resetting Redux State we’ve seen a way to reuse reducer logic to reset the state by creating a root reducer. But that’s not the only way to reuse reducer logic, and higher-order reducers come into the scene to help us with reusability and reducing code duplication. Higher-order reducers, unlike the root reducer approach, allow […]

Redux

Resetting Redux State with a Root Reducer

Have you ever had to reset your Redux state to its initial state in your reducers? Resetting the state is something lots of apps need to do. A typical example on when the app state must be reset could be when the user logs out. The most naive approach, which I’ve seen used many times, […]

Redux

An Introduction to Redux’s Core Concepts

Redux is a predictable state container for JavaScript apps, and a very valuable tool for organizing application state. It’s a popular library to manage state in React apps, but it can be used just as well with Angular, Vue.js or just plain old vanilla JavaScript. One thing most people find difficult about Redux is knowing […]

Redux

Functional Redux Reducers with Ramda

In a recent poll of react developers about their favourite libraries that change the way they code, ramda (a functional JavaScript library) came out on top. In this tutorial, we walk through a redux reducer, introducing ten ramda functions which you can start using in your own projects. What Is Ramda? ramda is a JavaScript […]