1 00:00:00,630 --> 00:00:01,020 Awesome. 2 00:00:01,020 --> 00:00:03,790 With our sorted state value in place now. 3 00:00:03,810 --> 00:00:08,760 Want to add a placeholder for the pageant function that we're going to create a bit later. 4 00:00:09,150 --> 00:00:14,190 So we're gonna have to utilize directory then we're going to look for helpers. 5 00:00:14,190 --> 00:00:20,220 J.S. remember these were our helper functions and now we want to create another function for pageant 6 00:00:20,220 --> 00:00:20,750 action. 7 00:00:20,880 --> 00:00:25,080 So badge you name something like that on the next ported right away. 8 00:00:25,100 --> 00:00:28,830 This is gonna be a function that I'm going to call this pageant night. 9 00:00:28,980 --> 00:00:30,970 And here I'm going to passing the product. 10 00:00:30,990 --> 00:00:33,320 Now what product I'm gonna be passing. 11 00:00:33,540 --> 00:00:41,450 Well within the product context instead of passing in product directly to set sorted in fact we're gonna 12 00:00:41,490 --> 00:00:43,430 run them through pageant first. 13 00:00:43,480 --> 00:00:45,060 So we're going to have our function. 14 00:00:45,060 --> 00:00:50,880 We're going to invoke the function by passing in the product and that that function is already in return 15 00:00:50,900 --> 00:00:53,080 the pageant native product. 16 00:00:53,130 --> 00:00:55,380 So within the helpers we're gonna say all right. 17 00:00:55,380 --> 00:00:57,260 So we're going to be passing in the product. 18 00:00:57,270 --> 00:01:02,300 And again since we're just creating a placeholder I'm just gonna return the same product. 19 00:01:02,670 --> 00:01:05,250 But this is where our functionality is gonna be here. 20 00:01:05,640 --> 00:01:10,040 So I'm going to write our code goes here. 21 00:01:10,050 --> 00:01:14,670 So here we're gonna set up our logic and then eventually of course we're going to return perhaps United 22 00:01:14,680 --> 00:01:19,830 products not just the product but since we're just setting up the place holder whatever products I'm 23 00:01:19,830 --> 00:01:22,410 going to be passing I'm gonna be returning from this function. 24 00:01:22,770 --> 00:01:29,730 So within the product context up on the top I'm going to import it and then sincerity half feature products 25 00:01:29,730 --> 00:01:30,780 and flattened product. 26 00:01:30,960 --> 00:01:34,800 I can just add a comma and we're going write Pat G Nate. 27 00:01:34,830 --> 00:01:36,360 That's the function we're looking for. 28 00:01:36,420 --> 00:01:41,630 And like I said remember we had set sorted and we directly passed in the product. 29 00:01:41,670 --> 00:01:47,520 So the difference is gonna be I'm gonna write my badge in innate function and then I'm going to invoke 30 00:01:47,520 --> 00:01:51,020 it and then we're going to pass in our product like so. 31 00:01:51,150 --> 00:01:58,590 And then eventually once we set up the page nation when we invoke set sorted in the state our state 32 00:01:58,590 --> 00:02:03,990 value is not just going to be a empty array or it's not going to be array of products it's going to 33 00:02:03,990 --> 00:02:06,290 be an array of arrays. 34 00:02:06,420 --> 00:02:10,980 We're going to set up our page nation just to show you that nothing of course changed. 35 00:02:11,070 --> 00:02:16,140 Again if we head back to our project if we refresh you're going to see that of course we still have 36 00:02:16,170 --> 00:02:21,990 all our products because the only thing right now we're doing within the pageant function is just returning 37 00:02:21,990 --> 00:02:24,120 the same product that we passed in.