DEV Community

Discussion on: Learn the Basics of Redux by Writing Your Own Version in 30 Lines

Collapse
devhammed profile image
Hammed Oyedele

It is using publish and subscribe pattern under the hood, look at the file responsible for it at github.com/reduxjs/redux/blob/mast...

Collapse
hugoazevedosoares profile image
hugoazevedosoares

Thanks Hammed! But I still don't know how it hooks with React components exactly. For Vue I can imagine how it would work, but not for React... Do you have any idea of which API Redux uses for this?

Thread Thread
hugoazevedosoares profile image
hugoazevedosoares

Oh, they use ContextAPI. Never mind, I think I got it now!

github.com/reduxjs/react-redux/blo...

Thread Thread
devhammed profile image
Hammed Oyedele

Definitely, the React bindings uses Context API under the hood as seen here: github.com/reduxjs/react-redux/blo...

Thread Thread
devhammed profile image
Hammed Oyedele • Edited on

Lol, I have replied before I saw your comment 😂