Once we have successfully dispatched our first action, I don't want to talk about why we would want
to return the old state at the very least, and what happens if our actions do not match, for example,
our dispatch, some kind of action that I'm not checking in the register.
And I guess let's start by our return.
So technically, we could return anything we would want from the register.
The problem is that, of course, our functionality will break and there's no better way to check that
out, but just changing our state.
So I'm going to go with shake and bake.
That's a strength.
I'm retiring.
And now, of course, I have not.
No, why do I have not a number?
Because the first time I pass in my initial state.
Awesome.
But then I'm returning my strength.
So, of course, since I switched from initial store to my strength, now all the functionality goes
bananas, even though my actions technically match correct at this point decrease.
And I'm checking for a decrease.
But how can I increase the count on a string of shake and bake?
That's the reason why, at the very least, you should always, always return to Old State, because
that's just going to ensure that your functionality will work.
That's the first case.
Then the second thing that I would want to cover.
What happens if our actions do not match?
I mean, if we dispatch some kind of action that is not checked in my producer and the simple answer
is nothing.
Nothing happens now.
We can see that if I, for example, copy and paste, I'm just going to change it to an action that
we will have in a later videos.
And that is an increase.
So as you can see at the moment, we're not checking for increase.
So if I save, even though the action is dispatched, my last action will be increased.
Since I'm not checking in my register, nothing happens.
So my action flows through the register.
If I don't have a matching if statement where I'm actually checking for that specific action, nothing.
I just return my old state, which at the very end is seventy three.
That's why when we have get state of course our value is also seventy three.