Building a state management tool like redux from scratch

In order to get a better understanding of state management tools, especially redux, I decided to build my own simpler version of the library, both in vanilla javascript to support any kind of project and also a react-typescript one.


You can see how in these code sanboxes dependencies, we only have bundler and in the case of the react one, react (and other stuff) but never redux. The whole point of these exercises was to re-create redux and react-redux myself, from scratch.


JS Redux Todo - CodeSandbox

JS Redux Todo - CodeSandbox

React Redux Todo - CodeSandbox

React Redux Todo - CodeSandbox


Also made this for a better understanding on middlewares and particularly what thunks are and how they work.


Redux Thunk React - CodeSandbox

Redux Thunk React - CodeSandbox

Finally, having recreated react-redux as it is today, with hooks and all the latest paterns, I wanted to go on a trip down memory lane and do a similar thing but looking back at how we used to do things in react before hooks. This version uses class components and in order to re-create react-redux, we create our very own connect higher order component.


React Redux (class) - CodeSandbox

React Redux (class) - CodeSandbox

Copyright 2023 © Borja Leiva

Made within London