Let’s dig in and understand the code.
First, create your store. This is where your application state will live:
Then, create your actions. This is where you change the state from your store:
By the way, because the actions are bound to the store, they are just pure functions :)
Now create your component. With Redux Zero your component can focus 100% on the UI and just call the actions that will automatically update the state:
Last but not least, plug the whole thing in your index file:
How simple was that? 💙
A big shoutout to Jason Miller, because Redux Zero was heavily inspired by his gist.
And of course, a big shoutout to
... read the whole story at medium.com.