1 00:00:00,240 --> 00:00:00,760 Perfect. 2 00:00:00,780 --> 00:00:08,580 And once we're done with our products now, let's deal with the car and we're going to start in the 3 00:00:08,580 --> 00:00:14,640 car context because again, all our functionality eventually is going to be here anyway. 4 00:00:15,000 --> 00:00:22,500 So we might as well do the dirty work first where I would want to start by going to the car context 5 00:00:22,710 --> 00:00:28,230 and in here jump to initial state and then let's just for values. 6 00:00:28,530 --> 00:00:33,570 First one is going to be the car, which at the moment is going to be empty array, but we'll flip it 7 00:00:33,570 --> 00:00:36,640 to the local storage interiors. 8 00:00:37,020 --> 00:00:41,430 Then I would want to go with total and underscore items. 9 00:00:41,820 --> 00:00:46,740 So that is just going to showcase how many items we have in a car total. 10 00:00:47,220 --> 00:00:50,790 So not how many products we might have three products, for example. 11 00:00:50,790 --> 00:00:56,880 But then if the amount for them is going to be different, then of course we're counting the total items. 12 00:00:57,150 --> 00:00:59,390 And again, we'll start with the zero over here. 13 00:00:59,820 --> 00:01:02,460 Then also we have total amount. 14 00:01:02,790 --> 00:01:06,630 So that is going to be the total dollar amount and just chokers that. 15 00:01:07,680 --> 00:01:15,960 For example, if we go here that are single product and then if I had to check it out, so now of course 16 00:01:15,960 --> 00:01:18,660 these are my products and I have four of them. 17 00:01:18,960 --> 00:01:27,390 And then since the amount for this one is five times five and the other two is one, that's why in the 18 00:01:27,390 --> 00:01:31,700 actual icon, I can see that I have a total of 12 items. 19 00:01:32,040 --> 00:01:38,010 And then when I talk about total amount, of course this is going to be my total amount when there's 20 00:01:38,010 --> 00:01:42,490 going to be some shipping fee and there's also going to be a or total. 21 00:01:42,780 --> 00:01:47,550 So that's going to be my total amount in the cost plus of the shipping fee. 22 00:01:47,970 --> 00:01:53,940 And that's why I'll set up my total on the underscore amount and by default it is going to be zero. 23 00:01:54,270 --> 00:01:58,430 And then as far as the shipping fee, I'm just going to come up with some value. 24 00:01:58,680 --> 00:02:04,440 So say a shipping fee and I'm going to go with five dollars and then thirty four cents. 25 00:02:04,800 --> 00:02:12,240 So I'm just going to go five thirty four because I'm displaying everything in the sense than in the 26 00:02:12,240 --> 00:02:13,020 card provider. 27 00:02:13,260 --> 00:02:15,120 I would want to set up my producer. 28 00:02:16,050 --> 00:02:23,240 And we're going to do that, of course, using user dicer, so say state and dispatch over here. 29 00:02:23,610 --> 00:02:27,990 So that's our function and that is equal to use producer. 30 00:02:28,260 --> 00:02:30,970 And then, of course, we pass in the car producer. 31 00:02:31,470 --> 00:02:33,900 So that is coming from the car producer. 32 00:02:34,290 --> 00:02:37,610 Again, same setup, which is don't have any functionality order. 33 00:02:37,890 --> 00:02:42,660 And then the second thing is my initial state. 34 00:02:43,050 --> 00:02:47,820 So where I have the value, of course, right now, I would want to pass in my state. 35 00:02:48,240 --> 00:02:50,460 So I'm going to go back to the JavaScript. 36 00:02:50,760 --> 00:02:55,010 No Curley's and then I'm passing in the state line. 37 00:02:55,050 --> 00:03:01,440 I also would want to set up my index because remember, just because we're setting up the context doesn't 38 00:03:01,440 --> 00:03:05,340 mean anything unless we wrap our application. 39 00:03:05,400 --> 00:03:09,560 And then, of course, we can access those values anywhere in our app. 40 00:03:10,020 --> 00:03:11,610 So open up the sidebar. 41 00:03:11,820 --> 00:03:15,570 We're navigating to index Ajaz. 42 00:03:15,930 --> 00:03:23,070 We already have card provider and then of course we have product provider, filter provider. 43 00:03:23,250 --> 00:03:27,510 And then inside of the filter provider we go with card. 44 00:03:28,970 --> 00:03:35,930 Card provider, and then we just wrapped the application thrown out anywhere in our app, we should 45 00:03:35,930 --> 00:03:38,210 have access to the card provider.