I Built My Own State Manager (Like REDUX)

preview_player
Показать описание
In this video, I'll guide you through the process of building your own state manager, similar to Redux, using proxy and observable patterns in a React TypeScript project. We'll start by setting up a new React project with Vite, creating a custom state manager, and building custom hooks like useSelector and useDispatch to manage our global store efficiently.

You'll learn how to:
- Implement a generic Observable type to represent the store.
- Create a createObservable function to manage global state and subscribers.
- Develop a custom useSelector hook to subscribe components to the global store.
- Design a useDispatch hook to handle state updates effectively.
- Use these custom hooks to build a working counter application with increment and decrement functionality.

🔗 Source Code:

By the end of this video, you’ll have a solid understanding of how to create a custom state management solution from scratch!
If you find this tutorial helpful, make sure to like, share, and subscribe for more content like this. Comment below if you'd like to see an advanced version using other patterns!
Рекомендации по теме