In the previous video, we saw how to implement the remove favorite function, the removal of its property
like we have created a new company.
We have exploded it to our budget.
We have used a remote favorite and then we have like brought the logic friendly movie.
It's using the filter functions on the favorites constraint that is basically they use straight up.
So now here we can see how to store the data since we are working with React like we are not going into
the database action, like using noise scale or a school like push to get a sequel Illinois school database
such as MongoDB.
But we thought that we can store data in local storage, right?
So how to do that?
So basically that it's a it's a simple procedure.
First thing you have to clear the data structure in your local storage.
So first, we'll do that here.
Before I add favorite movie, because I'm doing it before, because often you create the local storage
data structure, my data structure, data storage, basically to store data like it should be some clones
and definitions on all the stored data, what should be the variable names?
So once we give the data structure in the local storage, then when we are adding new favorites, we
can store them and then removing your favorites.
We can delete it from them.
So that's why we do it before.
So how to do that concert?
They've both.
Local.
Storage.
So now we'll be creating that data center, so I'll recreate the data structure, local storage dot
stack item.
So basically, this what it will do is that it will create a variable to store the data.
So what should be the variable and what should be the act moving up favorites?
OK.
10, what kind of data we should start, we should start the different objects today that's really based,
like from there you are one of the OMD API that we get the data.
It will be not like.
It will be something in a day type, data type, format, like plain text or something that we are putting
into that JSON.
So that's very amusing, extremely fast.
Items.
So basically, once once we did this now, the next step is whenever we are using the add favorite movie
or remote favorite movie, you have to call the sample local storage and save the data.
So there are two steps remaining.
So in the atmosphere, after setting the movies, we have to store them that local data.
So save the local storage and then we have to send the new list your favorite list.
That's it.
So what we'll do, it will take the new favorite items and then these items will be stored under the
Variable Quality Act movie up favorites.
The same thing how to delete So deleting is also a simple procedure bursting into two lines of code
basically said favorites.
New favorite list.
And then.
Sample local storage.
Your favorite list?
So in the previous video, like we did not do, this line of work is basically you are changing the
favorites like we are updating the favorites, so whenever we delete it, right, so we have to whenever
we deleted, we have to admit it.
So that's why I'm updating with the using the set favorites function, which are the favorites value.
After updating it, we have to basically again save it for the middle class to ensure that same variable
reaction will be our favorite.
So once if we do this.
As you can see, I am refreshed and the more everything from my favorites.
And then I'll refresh it again.
Can go to the application.
Your local storage is empty, right?
I'm clearing it if it is not empty, it empty again reflected in check.
Now I would refer, you have it's empty.
So now it does.
So tried movies and search.
Yes and no, Nolan basically on two.
And three more, these three men with 11 brains against the we're having three movies.
And now we have created a key like movie, have favorites.
This is basically the variable name in programming, and it has a value of the design or the design
object.
Right?
You can click on this.
You can see the title here, everything.
And then there are three items in that.
All the favorites that we had.
So now I'm sorry.
I'm deleting the first thing anymore, and then you can see it automatically deleted.
The first thing ended up later.
So what is happening whenever we click on Delete?
It is performing this filter function and updating that favorites array.
After updating the favorites, edit dynamically updated the storage.
So basically everything is happening simultaneously.
One after the other.
That is a beautiful day, and whenever we are like, oh, no, we are not removed from forever.
It does not disturb.
The remaining good will basically consider the books that the animal fan favorites are using the static
of favorite.
It will only update the constant that are present inside these books.
So this is how easy working with reactors judge.
Basically, you can create a function, perform, map or filter out kind of function properly.
Kind of methods are not desirous, and then you can store the data you want in the form of IS.
So with this, we have completed building the app like basically the search feature of movies, seeing
all the movies like all the languages, let us try some in the movie like like on.
Can see if we can get the movie we can add to favorites, also the regional movies like Let Me Search
Some Movie in Telugu, like you see.
Can see this one, we can add it.
Then you can search for all the movies, so this is a good feature.
You can search for all the movies, you can add it to favorites, refresh it, come any time, see the
favorites, and this will be the checklist if you want to go one step further.
The thing that you can do is that whenever you hover on this, you can like basically when you hover
on the favorites, then you can see the trailer of the film like Kannada YouTube playing like that,
and you can create a separate page whenever you click on Avengers.
Then a separate page will open by Ah, let me tell you.
Like this update, we will open with the image and also the details of the film.
As you can see here, all the details like what is the title?
Here I am day-by-day type movie poster, everything like all the details, a blueprint like as you can
see in different already platforms where you click on the movie, you will get all the details regarding
the movie.
So yeah, you going to go one step ahead and then you would like solve all this up challenges that you
want to do.
This is the basic, like the movie app that we decided to finish in the start of the project, and we
successfully completed and implemented all the features that we just let, such as our two favorite
and periods.
So for the details like who have a summary on what we did from start to then we'll see in the next few.