ProgrammingFarmer

Article Tag: Redux

Redux, React2023-08-31

Understanding Redux Source Code (5) - From HOC to Hooks, Implementing useSelector and useDispatch

As React-Redux versions have evolved, the official recommendation has shifted toward using Hooks instead of the previous HOC pattern (e.g., `connect`). In this article, we'll explore the benefits of this transition and understand and implement React-Redux's most important Hooks - useSelector and useDispatch.

Redux, React2023-07-30

Understanding Redux Source Code (4) - Understanding React-Redux Combination Through Provider and connect

In the frontend world, it's uncommon to use Redux alone, but rather React and Redux together, aka React-Redux. In this article, we'll explore the implementation of the core parts of React-Redux, focusing mainly on the Provider component and connect method.

Redux, JavaScript2022-01-20

Understanding Redux Source Code (3) - Let's Implement combineReducers

In the previous two articles about Redux source code, we implemented createStore and applyMiddleware. In this article, we will implement combineReducers, which is responsible for integrating multiple reducers, to understand how Redux accomplishes this.

Redux, JavaScript2021-12-30

Understanding Redux Source Code (2) - Implementing middlewares, applyMiddleware, and createStore enhancer

Following the previous Redux series article where we implemented createStore's getState, dispatch, and subscribe, this article will advance to implementing Redux middleware-related functionality such as applyMiddleware and createStore's enhancer. Let's explore Redux more deeply with curiosity.

Redux, JavaScript2021-12-01

Understanding Redux Source Code (1) - Implementing createStore's getState, dispatch, and subscribe

I was curious about how Redux implements centralized state management and unidirectional data flow concepts, so I decided to read the Redux source code and implement a basic createStore function, focusing on the getState, dispatch, and subscribe APIs.