1
00:00:00,610 --> 00:00:05,470
In the previous reader, we saw how to implement the movie selling component in the search box.

2
00:00:05,830 --> 00:00:11,920
So now in this video, we'll see how to get the movies from that such know what the users searches in

3
00:00:11,920 --> 00:00:12,610
the search box.

4
00:00:13,270 --> 00:00:15,410
So for that, we have to get the request.

5
00:00:15,410 --> 00:00:18,700
So I'll be creating a constant call, get movie request.

6
00:00:24,550 --> 00:00:29,920
They'll be using the and await kind of JavaScript programming yet.

7
00:00:30,280 --> 00:00:38,140
So what this does is that it will like I think what it does is that it will implement one function completely

8
00:00:38,140 --> 00:00:39,580
and then go on to the next function.

9
00:00:39,580 --> 00:00:44,680
So the next function will await for a certain amount of time until the first function is like first,

10
00:00:45,280 --> 00:00:50,200
what we're implementing, the first process under the first was just totally completed.

11
00:00:50,710 --> 00:00:56,230
So I think it is very popular in JavaScript, any after use it whenever you are dealing with or like

12
00:00:56,230 --> 00:01:01,600
you are a recursion that some complex programming, some complex retrieval later to burn, etc..

13
00:01:02,940 --> 00:01:04,800
So I'll take that search and.

14
00:01:07,530 --> 00:01:13,890
So I want to know what the user is searching, so when the user types of any user can store in the search

15
00:01:13,890 --> 00:01:15,900
value and I'll be sending avenges as the laptop.

16
00:01:19,680 --> 00:01:20,820
So now said this.

17
00:01:21,920 --> 00:01:23,080
I'll be calling the UN.

18
00:01:25,690 --> 00:01:26,710
You are and will be.

19
00:01:27,430 --> 00:01:33,940
So I'll be using these kind of brackets so that inside the stream, we can use the JavaScript objects,

20
00:01:34,120 --> 00:01:38,650
that maybe it is important to use these kind of codes.

21
00:01:39,750 --> 00:01:44,310
You can see in the top left of your laptop, we would be having this negation.

22
00:01:44,550 --> 00:01:45,210
Of course.

23
00:01:45,990 --> 00:01:46,380
So.

24
00:01:57,240 --> 00:01:58,320
So he didn't set the.

25
00:02:01,660 --> 00:02:06,340
But we need to have to get data API ready, so we'll be opening the postman.

26
00:02:08,920 --> 00:02:12,160
William Beebe, EPA dot com, come.

27
00:02:14,690 --> 00:02:15,010
Like.

28
00:02:16,110 --> 00:02:16,890
Question mark.

29
00:02:19,580 --> 00:02:24,530
So now this is really about unlike anything after the question mark in the audience will be parameters

30
00:02:25,190 --> 00:02:30,650
for the as will be the search parameter for the search parameter should be a valid revisit search value.

31
00:02:30,950 --> 00:02:35,570
So to say the search engine will be using this dollars symbol, that's why I've said they're him to

32
00:02:35,570 --> 00:02:36,230
use this data.

33
00:02:36,230 --> 00:02:38,960
And then the JavaScript objects are constants.

34
00:02:38,960 --> 00:02:40,010
You have to use these kind of.

35
00:02:41,320 --> 00:02:42,550
Cornish quotation marks.

36
00:02:44,070 --> 00:02:45,310
Medical research value.

37
00:02:47,180 --> 00:02:48,980
And API key.

38
00:02:52,340 --> 00:02:53,580
Maybe it will be.

39
00:02:54,800 --> 00:02:59,380
We'll we'll see what bipartisanship picking through Verizon EPA it.

40
00:03:01,020 --> 00:03:01,970
Can use that already.

41
00:03:04,030 --> 00:03:07,090
So once this is done, we have the you are in and all, you'll wait for the response.

42
00:03:08,270 --> 00:03:09,460
Sponsorship Wahlstrom.

43
00:03:11,320 --> 00:03:11,730
Avait.

44
00:03:14,150 --> 00:03:14,860
Fetch you.

45
00:03:15,110 --> 00:03:20,040
So what this does is that it will like it will implement a get request to that, you added.

46
00:03:20,080 --> 00:03:24,140
It will be said like it will be sending a request like we wanted the data from this, you ought to.

47
00:03:25,030 --> 00:03:26,080
We were fetching data.

48
00:03:27,320 --> 00:03:31,190
The new law will get that response in art like.

49
00:03:32,880 --> 00:03:38,910
And, you know, like in response, much so we have to change that into Jason, so I'll be changing

50
00:03:38,910 --> 00:03:43,110
the response in two days and rejoining instead of constant.

51
00:03:43,560 --> 00:03:44,490
That's one suggestion.

52
00:03:53,410 --> 00:03:55,400
I'm retaining responsible, Jason.

53
00:03:55,690 --> 00:04:00,700
So now we have the information in the form of Jason, like you can see.

54
00:04:02,080 --> 00:04:07,810
This is the JASON format will be everything will be in this kind of format will be getting this format.

55
00:04:08,930 --> 00:04:11,240
So now what we're doing is.

56
00:04:14,580 --> 00:04:14,880
If.

57
00:04:16,600 --> 00:04:17,380
Response.

58
00:04:21,510 --> 00:04:25,680
There's a type of their response response.

59
00:04:27,760 --> 00:04:29,080
But such.

60
00:04:33,310 --> 00:04:39,370
So this will be true if we get any information regarding that search value, like if the search value

61
00:04:39,370 --> 00:04:42,580
like that is normally found, then this will be false, right?

62
00:04:42,830 --> 00:04:46,570
So if there are some movies, one or two movies, then only this will be true.

63
00:04:46,570 --> 00:04:52,180
And if this is true only like we have and we have to set the movies, we have to use that movies function

64
00:04:52,180 --> 00:04:53,890
and change the value of movies.

65
00:04:55,380 --> 00:04:56,940
Said movies will be a response.

66
00:04:58,640 --> 00:04:59,390
Yes, under.

67
00:05:00,440 --> 00:05:00,920
Such.

68
00:05:03,030 --> 00:05:09,690
So with this, we are like dynamically updating the movie's value whenever the search value changes.

69
00:05:10,290 --> 00:05:15,330
So not only did we have to use the use to consume, I'll be using the use effect look.

70
00:05:21,020 --> 00:05:24,290
So what this does is let me experiment.

71
00:05:29,170 --> 00:05:30,580
So we're all.

72
00:05:33,150 --> 00:05:33,570
Get.

73
00:05:34,900 --> 00:05:35,860
Will we request?

74
00:05:37,980 --> 00:05:38,760
It's natural.

75
00:05:41,190 --> 00:05:41,670
Comma.

76
00:05:43,580 --> 00:05:44,230
Such central.

77
00:05:45,310 --> 00:05:52,360
So what this line of code that is that use effect is the hope that always exit and exit gates whenever

78
00:05:52,360 --> 00:05:53,280
the repetition on it.

79
00:05:53,650 --> 00:05:57,070
So whenever we pitch, something is changing in the like.

80
00:05:57,790 --> 00:06:00,700
So like, it should change so that that will be the second parameter.

81
00:06:00,700 --> 00:06:02,590
We are giving the second button address search value.

82
00:06:02,890 --> 00:06:07,600
So whenever the search value changes, that is the information that the user is giving.

83
00:06:07,600 --> 00:06:11,080
Instead the search box, then it will execute.

84
00:06:11,080 --> 00:06:13,960
The first parameter that is given will be the search value.

85
00:06:14,410 --> 00:06:17,620
So whenever the search value changes, then it will call this function.

86
00:06:18,010 --> 00:06:22,630
So use effect to call is used in this way, like whenever one parameter changes, you have to call another

87
00:06:22,630 --> 00:06:23,140
parameter.

88
00:06:23,680 --> 00:06:28,840
So whenever a search engine is, we are calling this function and getting that you are changing it with

89
00:06:28,840 --> 00:06:30,820
Jason and then mortgages Jason.

90
00:06:31,120 --> 00:06:35,320
So him and me, like all the movies, will be sending the movies value.

91
00:06:36,100 --> 00:06:40,780
So and then inside the movies list, basically, we are printing the posters.

92
00:06:42,370 --> 00:06:44,110
So we'll see whether it is working or not.

93
00:06:51,780 --> 00:06:58,950
So as you can see, like we are getting only one at one thing, one one will be regarding that.

94
00:06:59,490 --> 00:07:03,870
If you type, we are getting the first thing, but we're not getting the air, we're getting the rest

95
00:07:03,870 --> 00:07:04,800
of the images on.

96
00:07:04,920 --> 00:07:11,550
But there is some difference, like we are not like some styling issue, like we are getting all normal

97
00:07:11,550 --> 00:07:17,410
with like a you type movie, like morally better, getting the first movie, the second movie and also

98
00:07:17,410 --> 00:07:18,810
a few scenes, I think.

99
00:07:19,200 --> 00:07:21,500
But the styling is like there is a lot of.

100
00:07:22,290 --> 00:07:26,550
So we'll see what is wrong in the styling and everything from that in the next reader.

101
00:07:26,820 --> 00:07:33,180
So now I think you've got the basic idea all good and that the movie's content based on the search value

102
00:07:33,180 --> 00:07:34,320
given by the user, right?

103
00:07:34,920 --> 00:07:39,720
So basically, finally, we are doing what they're doing is we are getting the like, creating a function.

104
00:07:39,780 --> 00:07:44,100
Getting there you are pitching that you are data changing that in response to our data.

105
00:07:44,220 --> 00:07:50,820
If there is a movie like there is data available, then the Switch will change the movies content using

106
00:07:50,820 --> 00:07:52,470
the same movies function to that data.

107
00:07:52,890 --> 00:07:57,810
And whenever the search revenue changes will be rendering distinct whenever this and the movie will

108
00:07:57,810 --> 00:07:58,440
be updated.

109
00:07:58,710 --> 00:08:04,050
And then, as you can see, the movies we are sending, this has the prop movies, different images

110
00:08:04,050 --> 00:08:05,130
of that movies.

111
00:08:05,610 --> 00:08:12,120
So we have done with the dynamic, additional or dynamic creation of the movie data, and the next reader

112
00:08:12,120 --> 00:08:14,400
will change that style that we are having yet.

113
00:08:15,600 --> 00:08:19,500
So we are going to be adding all the movies, but that's not good.

114
00:08:20,110 --> 00:08:24,420
We didn't see that from the in the next year and also will continue to add to favorites, remove from

115
00:08:24,420 --> 00:08:28,020
favorites and storing it, joining the data to the local storage and everything.

116
00:08:28,710 --> 00:08:29,010
Thank.
