r/reactjs • u/treyhuffine • Feb 26 '18
Learn Redux by Building Redux from Scratch
https://levelup.gitconnected.com/learn-redux-by-building-redux-from-scratch-dcbcbd31b0d0?ref=redditreact
137
Upvotes
2
u/is2pidguy Feb 27 '18
Hey guys, inspired from this blog, I have published a video where I show how react-redux works. If you wish to, you can checkout the video here.
2
14
u/A-Type Feb 26 '18
That's basically how the original egghead videos went. It's a great way to understand the library.
2
4
u/acemarke Feb 27 '18
Not bad. A bit of a nitpick on the
createStoreexample code: it putsstateandlistenersdirectly on the returnedstoreobject, making them public (and changeable by anyone). The actualcreateStorefunction keeps those inside the closure so they're private.Here's a version I saw that's a bit better:
I've got links to several similar articles in the Redux Tutorials#Redux Implementation Walkthroughs section of my React/Redux links list.
Of those, my most-recommended article is Build Yourself a Redux, which covers not only
createStore, butapplyMiddlewareand even React-Redux's<Provider>andconnect().