1 00:00:00,540 --> 00:00:06,990 When we create a store in Redux, we have access to get state function and as anyone wants to make a 2 00:00:06,990 --> 00:00:14,940 wild guess what this function is doing, and I can give you a hint, the name describes everything that 3 00:00:14,940 --> 00:00:16,340 the function is performing. 4 00:00:16,710 --> 00:00:23,220 So you can probably already guess essentially with get state effectively, we're just going to get back 5 00:00:23,220 --> 00:00:23,730 our state. 6 00:00:24,180 --> 00:00:26,190 What is our initial state right now? 7 00:00:26,460 --> 00:00:32,310 It is property count and the value of zero as it's going to be changing, of course, then we're going 8 00:00:32,310 --> 00:00:34,750 to be returning the latest state. 9 00:00:35,190 --> 00:00:38,280 Now, I also want to showcase that that is true. 10 00:00:38,680 --> 00:00:42,120 Otherwise, you might be thinking that there's some sorcery involved. 11 00:00:42,420 --> 00:00:51,950 So right below the store, I'm going to console my store, get state and let's invoke the function. 12 00:00:52,290 --> 00:00:53,820 So now I have two things in a console. 13 00:00:54,600 --> 00:00:57,060 Have the state in action coming from the producer. 14 00:00:57,300 --> 00:01:00,750 And then, of course, I have my initial state. 15 00:01:01,080 --> 00:01:06,750 And then just to showcase that, we could pass this to our components, we're just going to try it out 16 00:01:06,750 --> 00:01:07,550 with a bar. 17 00:01:07,770 --> 00:01:12,470 Keep in mind, of course, when we are going to be setting up our application, we will use the special 18 00:01:12,480 --> 00:01:16,320 library for that to connect our Redock store to our application. 19 00:01:16,320 --> 00:01:18,960 And the library name is React Redux. 20 00:01:19,350 --> 00:01:25,410 But since we're just testing things out, I would still want to pass it down to a number so we don't 21 00:01:25,410 --> 00:01:26,220 have the number. 22 00:01:26,220 --> 00:01:35,220 I'm going to create a card prop and I'm going to send that card prop equal to store get state function. 23 00:01:35,520 --> 00:01:36,960 So we pass it down as a prop. 24 00:01:37,530 --> 00:01:37,840 Good. 25 00:01:38,160 --> 00:01:40,830 Now, of course, we need to look for our Navar component. 26 00:01:41,160 --> 00:01:44,610 And then since I passed that down, now of course I can access it. 27 00:01:44,770 --> 00:01:47,030 I remember the name was Card. 28 00:01:47,500 --> 00:01:48,810 Now we have few options. 29 00:01:48,990 --> 00:01:55,470 Either I can access it directly because I know that it is an object or just to be more clear, I'm going 30 00:01:55,470 --> 00:01:56,160 to destruction. 31 00:01:56,550 --> 00:01:58,170 So I'm going to go with CONSED. 32 00:01:58,410 --> 00:02:02,320 Then I'm looking for an account that is coming from my card prop. 33 00:02:02,550 --> 00:02:09,240 So if I'm going to change the zero that is hard coded to my current prob, I should again still have 34 00:02:09,240 --> 00:02:09,630 zero. 35 00:02:09,630 --> 00:02:14,790 But now in this case we're going to have an option of changing our initial state and that should show 36 00:02:14,790 --> 00:02:17,910 here all the way up on the top, on the right hand side. 37 00:02:18,300 --> 00:02:22,560 So I'm going to head back to Objets and then remember our initial store. 38 00:02:23,040 --> 00:02:28,740 If we set up everything correctly, then now we should have seventy eight, which we do because our 39 00:02:28,740 --> 00:02:30,300 initial state is seventy eight. 40 00:02:30,570 --> 00:02:36,180 And then of course since we passed that down to number, that's why it's represented right here.