1 00:00:00,450 --> 00:00:00,900 Beautiful. 2 00:00:00,930 --> 00:00:06,870 We covered the reasoning behind our setup, so knowledge dispatched two more actions, one for increase 3 00:00:07,140 --> 00:00:12,300 and the other one for her is said, I don't think I need that money decreases. 4 00:00:12,630 --> 00:00:19,410 So one by one, I'm just going to delete them and I want decrease and let's say a few increases. 5 00:00:19,830 --> 00:00:21,360 So it's copy and paste that one. 6 00:00:21,540 --> 00:00:23,950 And then at the very end, we're going to have a reset. 7 00:00:24,300 --> 00:00:26,370 So let me copy paste one more time. 8 00:00:26,700 --> 00:00:32,160 Let me set up all caps and then instead of increase, we're going to go with the reset. 9 00:00:32,490 --> 00:00:36,520 Now, I'm going to start with zero because I think that just going to be a better setup. 10 00:00:36,540 --> 00:00:43,260 So instead of Seventy-eight, my initial store will have a value for the count of zero. 11 00:00:43,570 --> 00:00:45,210 Now, of course, I have negative one. 12 00:00:45,660 --> 00:00:47,070 Why do I have negative one? 13 00:00:47,400 --> 00:00:51,870 Because I do have the action dispatched by the value of decrease. 14 00:00:52,170 --> 00:00:54,510 I'm checking that in my producer. 15 00:00:54,810 --> 00:00:57,150 And then of course, I just subtract one. 16 00:00:57,510 --> 00:01:03,660 Of course, I have three more actions and I would need to take care of them in my producer since I would 17 00:01:03,660 --> 00:01:04,620 want to speed this up. 18 00:01:05,460 --> 00:01:10,110 We're just going to copy and paste one too, and we just need to change these values around. 19 00:01:10,530 --> 00:01:13,470 So instead of decrease, of course, we're looking for increase. 20 00:01:13,770 --> 00:01:21,810 And yes, I will copy and paste because that will ensure that there are no typos. 21 00:01:22,140 --> 00:01:23,520 We have increase. 22 00:01:23,520 --> 00:01:29,610 And then also I'm going to do the same thing for reset, copy and paste. 23 00:01:29,980 --> 00:01:31,170 So now I have three things. 24 00:01:31,560 --> 00:01:33,930 I have decrease, increase and reset. 25 00:01:34,500 --> 00:01:40,410 And you can probably already guess that in this case we are going to have plus one and then here we're 26 00:01:40,410 --> 00:01:41,760 just going to set it equal to zero. 27 00:01:42,150 --> 00:01:47,090 Now, by mistake, of course, I copy and paste it the wrong way of setting up the state. 28 00:01:47,370 --> 00:01:48,600 So let me delete that. 29 00:01:48,810 --> 00:01:54,060 And probably it shouldn't be there anyway, since that's not the way how we can actually work with the 30 00:01:54,070 --> 00:01:54,480 redox. 31 00:01:54,720 --> 00:01:55,770 So let me save it. 32 00:01:55,900 --> 00:02:03,240 And now of course I have negative for y well because I should have fixed here the plus one would increase, 33 00:02:03,660 --> 00:02:06,420 then reset will be equal to zero. 34 00:02:06,720 --> 00:02:11,250 So instead of using the count, I don't really need it in this case since again I would just want to 35 00:02:11,250 --> 00:02:12,030 set it zero. 36 00:02:12,720 --> 00:02:21,240 So now returning the count with a value of zero and once I say I have zero y well because I decrease 37 00:02:21,240 --> 00:02:24,740 the first time, then I have two increases and then I reset it. 38 00:02:25,050 --> 00:02:29,430 So as we are going to be changing these values around, then you'll see that now we're going to have 39 00:02:29,430 --> 00:02:31,590 plus two again, we decrease. 40 00:02:31,770 --> 00:02:38,730 So minus one, then we reset back to zero and then we have increase plus one and plus one. 41 00:02:39,120 --> 00:02:42,240 So those will be the basics of working with Redox. 42 00:02:42,510 --> 00:02:49,260 Again, we have the store, we have the producer, and then we have the actions which we dispatch using 43 00:02:49,320 --> 00:02:50,460 this patch method. 44 00:02:50,730 --> 00:02:57,660 And then in the reducer we just check for those actions for reaction type more properly. 45 00:02:57,960 --> 00:03:02,100 And then based on the action type, we set up functionality. 46 00:03:02,280 --> 00:03:05,240 What we would want the return from producer. 47 00:03:05,760 --> 00:03:12,900 Now, if there is an action dispatch that does not match any of our IF statement, well, we're just 48 00:03:12,900 --> 00:03:14,970 going to return a whole state. 49 00:03:15,210 --> 00:03:18,810 And to showcase that, I'm just going to copy and paste. 50 00:03:19,020 --> 00:03:24,300 And then instead of having some kind of action that I'm checking in reducer, why don't we just say 51 00:03:24,300 --> 00:03:25,010 around them? 52 00:03:25,260 --> 00:03:30,450 So of course, I know I'm not checking for that action, but it still doesn't affect my result. 53 00:03:30,900 --> 00:03:35,420 So even though I'm not checking, I'm still returning the old state, which is awesome. 54 00:03:35,640 --> 00:03:41,910 And then if I have the action that does have the matching Eppstein, then of course we are performing 55 00:03:42,090 --> 00:03:43,140 the functionality.