In the previous reader, we saw how to implement the movie selling component in the search box.
So now in this video, we'll see how to get the movies from that such know what the users searches in
the search box.
So for that, we have to get the request.
So I'll be creating a constant call, get movie request.
They'll be using the and await kind of JavaScript programming yet.
So what this does is that it will like I think what it does is that it will implement one function completely
and then go on to the next function.
So the next function will await for a certain amount of time until the first function is like first,
what we're implementing, the first process under the first was just totally completed.
So I think it is very popular in JavaScript, any after use it whenever you are dealing with or like
you are a recursion that some complex programming, some complex retrieval later to burn, etc..
So I'll take that search and.
So I want to know what the user is searching, so when the user types of any user can store in the search
value and I'll be sending avenges as the laptop.
So now said this.
I'll be calling the UN.
You are and will be.
So I'll be using these kind of brackets so that inside the stream, we can use the JavaScript objects,
that maybe it is important to use these kind of codes.
You can see in the top left of your laptop, we would be having this negation.
Of course.
So.
So he didn't set the.
But we need to have to get data API ready, so we'll be opening the postman.
William Beebe, EPA dot com, come.
Like.
Question mark.
So now this is really about unlike anything after the question mark in the audience will be parameters
for the as will be the search parameter for the search parameter should be a valid revisit search value.
So to say the search engine will be using this dollars symbol, that's why I've said they're him to
use this data.
And then the JavaScript objects are constants.
You have to use these kind of.
Cornish quotation marks.
Medical research value.
And API key.
Maybe it will be.
We'll we'll see what bipartisanship picking through Verizon EPA it.
Can use that already.
So once this is done, we have the you are in and all, you'll wait for the response.
Sponsorship Wahlstrom.
Avait.
Fetch you.
So what this does is that it will like it will implement a get request to that, you added.
It will be said like it will be sending a request like we wanted the data from this, you ought to.
We were fetching data.
The new law will get that response in art like.
And, you know, like in response, much so we have to change that into Jason, so I'll be changing
the response in two days and rejoining instead of constant.
That's one suggestion.
I'm retaining responsible, Jason.
So now we have the information in the form of Jason, like you can see.
This is the JASON format will be everything will be in this kind of format will be getting this format.
So now what we're doing is.
If.
Response.
There's a type of their response response.
But such.
So this will be true if we get any information regarding that search value, like if the search value
like that is normally found, then this will be false, right?
So if there are some movies, one or two movies, then only this will be true.
And if this is true only like we have and we have to set the movies, we have to use that movies function
and change the value of movies.
Said movies will be a response.
Yes, under.
Such.
So with this, we are like dynamically updating the movie's value whenever the search value changes.
So not only did we have to use the use to consume, I'll be using the use effect look.
So what this does is let me experiment.
So we're all.
Get.
Will we request?
It's natural.
Comma.
Such central.
So what this line of code that is that use effect is the hope that always exit and exit gates whenever
the repetition on it.
So whenever we pitch, something is changing in the like.
So like, it should change so that that will be the second parameter.
We are giving the second button address search value.
So whenever the search value changes, that is the information that the user is giving.
Instead the search box, then it will execute.
The first parameter that is given will be the search value.
So whenever the search value changes, then it will call this function.
So use effect to call is used in this way, like whenever one parameter changes, you have to call another
parameter.
So whenever a search engine is, we are calling this function and getting that you are changing it with
Jason and then mortgages Jason.
So him and me, like all the movies, will be sending the movies value.
So and then inside the movies list, basically, we are printing the posters.
So we'll see whether it is working or not.
So as you can see, like we are getting only one at one thing, one one will be regarding that.
If you type, we are getting the first thing, but we're not getting the air, we're getting the rest
of the images on.
But there is some difference, like we are not like some styling issue, like we are getting all normal
with like a you type movie, like morally better, getting the first movie, the second movie and also
a few scenes, I think.
But the styling is like there is a lot of.
So we'll see what is wrong in the styling and everything from that in the next reader.
So now I think you've got the basic idea all good and that the movie's content based on the search value
given by the user, right?
So basically, finally, we are doing what they're doing is we are getting the like, creating a function.
Getting there you are pitching that you are data changing that in response to our data.
If there is a movie like there is data available, then the Switch will change the movies content using
the same movies function to that data.
And whenever the search revenue changes will be rendering distinct whenever this and the movie will
be updated.
And then, as you can see, the movies we are sending, this has the prop movies, different images
of that movies.
So we have done with the dynamic, additional or dynamic creation of the movie data, and the next reader
will change that style that we are having yet.
So we are going to be adding all the movies, but that's not good.
We didn't see that from the in the next year and also will continue to add to favorites, remove from
favorites and storing it, joining the data to the local storage and everything.
Thank.