Beautiful.
We covered the reasoning behind our setup, so knowledge dispatched two more actions, one for increase
and the other one for her is said, I don't think I need that money decreases.
So one by one, I'm just going to delete them and I want decrease and let's say a few increases.
So it's copy and paste that one.
And then at the very end, we're going to have a reset.
So let me copy paste one more time.
Let me set up all caps and then instead of increase, we're going to go with the reset.
Now, I'm going to start with zero because I think that just going to be a better setup.
So instead of Seventy-eight, my initial store will have a value for the count of zero.
Now, of course, I have negative one.
Why do I have negative one?
Because I do have the action dispatched by the value of decrease.
I'm checking that in my producer.
And then of course, I just subtract one.
Of course, I have three more actions and I would need to take care of them in my producer since I would
want to speed this up.
We're just going to copy and paste one too, and we just need to change these values around.
So instead of decrease, of course, we're looking for increase.
And yes, I will copy and paste because that will ensure that there are no typos.
We have increase.
And then also I'm going to do the same thing for reset, copy and paste.
So now I have three things.
I have decrease, increase and reset.
And you can probably already guess that in this case we are going to have plus one and then here we're
just going to set it equal to zero.
Now, by mistake, of course, I copy and paste it the wrong way of setting up the state.
So let me delete that.
And probably it shouldn't be there anyway, since that's not the way how we can actually work with the
redox.
So let me save it.
And now of course I have negative for y well because I should have fixed here the plus one would increase,
then reset will be equal to zero.
So instead of using the count, I don't really need it in this case since again I would just want to
set it zero.
So now returning the count with a value of zero and once I say I have zero y well because I decrease
the first time, then I have two increases and then I reset it.
So as we are going to be changing these values around, then you'll see that now we're going to have
plus two again, we decrease.
So minus one, then we reset back to zero and then we have increase plus one and plus one.
So those will be the basics of working with Redox.
Again, we have the store, we have the producer, and then we have the actions which we dispatch using
this patch method.
And then in the reducer we just check for those actions for reaction type more properly.
And then based on the action type, we set up functionality.
What we would want the return from producer.
Now, if there is an action dispatch that does not match any of our IF statement, well, we're just
going to return a whole state.
And to showcase that, I'm just going to copy and paste.
And then instead of having some kind of action that I'm checking in reducer, why don't we just say
around them?
So of course, I know I'm not checking for that action, but it still doesn't affect my result.
So even though I'm not checking, I'm still returning the old state, which is awesome.
And then if I have the action that does have the matching Eppstein, then of course we are performing
the functionality.