Awesome.
With our sorted state value in place now.
Want to add a placeholder for the pageant function that we're going to create a bit later.
So we're gonna have to utilize directory then we're going to look for helpers.
J.S. remember these were our helper functions and now we want to create another function for pageant
action.
So badge you name something like that on the next ported right away.
This is gonna be a function that I'm going to call this pageant night.
And here I'm going to passing the product.
Now what product I'm gonna be passing.
Well within the product context instead of passing in product directly to set sorted in fact we're gonna
run them through pageant first.
So we're going to have our function.
We're going to invoke the function by passing in the product and that that function is already in return
the pageant native product.
So within the helpers we're gonna say all right.
So we're going to be passing in the product.
And again since we're just creating a placeholder I'm just gonna return the same product.
But this is where our functionality is gonna be here.
So I'm going to write our code goes here.
So here we're gonna set up our logic and then eventually of course we're going to return perhaps United
products not just the product but since we're just setting up the place holder whatever products I'm
going to be passing I'm gonna be returning from this function.
So within the product context up on the top I'm going to import it and then sincerity half feature products
and flattened product.
I can just add a comma and we're going write Pat G Nate.
That's the function we're looking for.
And like I said remember we had set sorted and we directly passed in the product.
So the difference is gonna be I'm gonna write my badge in innate function and then I'm going to invoke
it and then we're going to pass in our product like so.
And then eventually once we set up the page nation when we invoke set sorted in the state our state
value is not just going to be a empty array or it's not going to be array of products it's going to
be an array of arrays.
We're going to set up our page nation just to show you that nothing of course changed.
Again if we head back to our project if we refresh you're going to see that of course we still have
all our products because the only thing right now we're doing within the pageant function is just returning
the same product that we passed in.