1 00:00:00,470 --> 00:00:05,750 Once we have successfully dispatched our first action, I don't want to talk about why we would want 2 00:00:05,750 --> 00:00:13,940 to return the old state at the very least, and what happens if our actions do not match, for example, 3 00:00:14,090 --> 00:00:18,680 our dispatch, some kind of action that I'm not checking in the register. 4 00:00:19,040 --> 00:00:21,430 And I guess let's start by our return. 5 00:00:21,800 --> 00:00:25,250 So technically, we could return anything we would want from the register. 6 00:00:25,970 --> 00:00:32,090 The problem is that, of course, our functionality will break and there's no better way to check that 7 00:00:32,090 --> 00:00:34,100 out, but just changing our state. 8 00:00:34,610 --> 00:00:37,580 So I'm going to go with shake and bake. 9 00:00:37,800 --> 00:00:38,470 That's a strength. 10 00:00:38,540 --> 00:00:39,220 I'm retiring. 11 00:00:39,710 --> 00:00:41,520 And now, of course, I have not. 12 00:00:41,600 --> 00:00:43,820 No, why do I have not a number? 13 00:00:44,210 --> 00:00:46,940 Because the first time I pass in my initial state. 14 00:00:47,180 --> 00:00:47,650 Awesome. 15 00:00:48,110 --> 00:00:50,230 But then I'm returning my strength. 16 00:00:50,750 --> 00:00:57,260 So, of course, since I switched from initial store to my strength, now all the functionality goes 17 00:00:57,260 --> 00:01:02,750 bananas, even though my actions technically match correct at this point decrease. 18 00:01:02,750 --> 00:01:03,850 And I'm checking for a decrease. 19 00:01:04,190 --> 00:01:08,540 But how can I increase the count on a string of shake and bake? 20 00:01:08,990 --> 00:01:15,170 That's the reason why, at the very least, you should always, always return to Old State, because 21 00:01:15,170 --> 00:01:18,080 that's just going to ensure that your functionality will work. 22 00:01:18,500 --> 00:01:19,760 That's the first case. 23 00:01:20,130 --> 00:01:21,980 Then the second thing that I would want to cover. 24 00:01:22,220 --> 00:01:25,540 What happens if our actions do not match? 25 00:01:26,000 --> 00:01:31,640 I mean, if we dispatch some kind of action that is not checked in my producer and the simple answer 26 00:01:31,640 --> 00:01:32,570 is nothing. 27 00:01:32,810 --> 00:01:34,700 Nothing happens now. 28 00:01:34,700 --> 00:01:40,430 We can see that if I, for example, copy and paste, I'm just going to change it to an action that 29 00:01:40,430 --> 00:01:42,860 we will have in a later videos. 30 00:01:43,190 --> 00:01:44,390 And that is an increase. 31 00:01:44,490 --> 00:01:48,140 So as you can see at the moment, we're not checking for increase. 32 00:01:48,500 --> 00:01:55,640 So if I save, even though the action is dispatched, my last action will be increased. 33 00:01:56,060 --> 00:01:59,300 Since I'm not checking in my register, nothing happens. 34 00:01:59,420 --> 00:02:01,520 So my action flows through the register. 35 00:02:01,700 --> 00:02:08,960 If I don't have a matching if statement where I'm actually checking for that specific action, nothing. 36 00:02:09,140 --> 00:02:13,990 I just return my old state, which at the very end is seventy three. 37 00:02:14,240 --> 00:02:19,390 That's why when we have get state of course our value is also seventy three.