So, this reducer doesn't really do anything. It takes the current state of the world and an action. It then ignores the action and just returns the current state of the world.
I'd love to implement more right now, but we'll first need to figure out what an action is.
TL;DR: an action is a plain old JavaScript object.
In practice, we tend to have some conventions as to how this works. Everything I'm about to say should be prefixed with "This is not required, it's just what we all tend to do because it's probably the best way to do this but you totally don't have to."
Actions typically have a "type" property. This makes sense, right? An action occured! You're first question will probably be "Well, neat. What type of action occured?"
After that, it's up to you and your application what other bits of relevant data there are, right?
But this is me and my calculator application—so, I make the calls around here.
Let's start with addition. We'll say that the type of the action is "ADD" and then there will be a value, we'll add that to the the "result" that's currently stored in state. Neat.
Basically, inside of our store, we need to write the logic that looks at the type of action that just came in and then figure out what exactly that means for the state of our application.