And once we have our global state available all throughout the application.
Now, of course, we can start working on the dashboard.
The thing is, though, when you work with get help API, while there have limits, each and every time
you would want update, we would need to make another request.
So technically you can do that, but you're run out of your quest pretty quickly.
That's why I provided some static data, which essentially just allows us to set up our whole application.
And then eventually hook it up to our fetch request, meaning there's going to be some global values.
We'll update those values each and every time we'll perform a search for the new user.
Now, you can find that data in the mob data.
So if you're looking at the context folder, you'll find more data.
And in that mock data, you'll have mock followers, mock repos, as well as the mock user.
So, again, why I provided this data is because I don't want you to run out the requests because essentially
you get up to 60 requests an hour.
What that means is that as we're developing the application, you'll run out of those requests very
quickly.
Now, of course, you don't need to use the data that I provided if you'd want to use a different user.
Most likely yourself, because that's something you would want to display right away.
Then just use this.
You are all and then change it to your username.
And then, of course, just copy the euro into a browser and you'll have access to that data.
So let me show you what I mean.
For example, if you change this to some kind of different user, I don't know w boss and if you'll
copy that, you'll have access to a user information copy and paste and you'll have a user information.
So again, set up your user name and then just copy this one into the monitor data.
If you don't want to use my data again, the reason why we're doing that, because we don't want to
run out or request.
We want to build out our whole application with the data that eventually we're going to be getting back.
And then also, of course, we'll just hook it up to our search form.
Now, I will leave this data eventually in our application because I wouldn't want to waste the user's
request as well.
Because we need to keep in mind that when someone comes to our application, they're using their own
requests because the way the GitHub API works, the requests are checked by the IP address.
So it's not checked by the user name.
So essentially what I'm saying, once somebody logs in, you're displaying some kind of data that you'd
want.
Most likely there's going to be information about your own people.
And then if he or she wants to look for different user, for example, where's boss?
And of course, we can do that.
We set up the search.
But this is the time when we are setting up that request.
So we're not wasting our request when the user loads it.
That's why we're using that static data.
And my key point was that if you don't like my mock data that I have here in the mock data folder,
for example, followers or repost or whatever, user just use the URLs that I provide, change values
to your username or whatever username you would want.
Like I just showed you with W boss, you can change it and then you're getting the info about this particular
user.
Then grab everything that you have.
And as a side note, I'm using the Google Chrome extension by the name of J.
Soundview.
That's how I have this view where I have correctly displayed everything that I'm getting back.
So just copy everything, then navigate back to a mock folder.
We have mock data folder and then in this case it would be a user.
So notice how I'm exporting default the object.
And of course, this is my data that I already provided.
So if you want a different info, just delete everything here and copy paste whatever you'd want.
So in this case, of course, we are displaying information about the West Bosch show eventually meaning
in a second we'll import this in to our context.
And of course, this is what we'll display.
So it's up to you.
Do it one by one.
If you want to have a different repost.
Just use the you are all that I provided.
Just change the user name.
And of course, repos is gonna be the biggest one because.
This is gonna give you hundred reposts.
So this is gonna be somewhat giant.
That's why I remember when you're changing this around to a mock repost, delete everything here, but
just export that array as a default because that's the functionality that I have.
Again, you can use my data and you can change it later if you want.
Or you can right away use the Yarl's search for your own users.
Meaning followers.
I guess more correctly than your your own user name as well as your own repost.
So you can use the URLs, just change the values and then copy and paste them in the mock data because
this is where we'll use it.
So what I would want to do next.
Well, I would want to save I guess the read me since I change it to his boss.
We can just leave it the way it is.
Again, it doesn't matter which ever user you want to display when the application loads.
Now, of course, I was just using your own profile because that would showcase what you're doing on
GitHub.
But as always, it's up to you.
And now, once we have the setup, either you're using my setup to one, I provide it, or you copied
and pasted with the on your values.
Now, in the context, JSC, you'll notice that we're importing we're importing moch user Mochrie post
as well as mock followers.
And then since I'm using provider right now, what's really cool is I can set up my state values using
you state and just pass in whatever I'm getting back from the user, whether that is going to be user
object or to repost.
So the array we Hungary repost the same 40 followers.
So in the GitHub provider.
Now, I'm going to change this around where I'm going to say that there's going to be a GitHub user
and the name here is important because eventually there's going to be a different user that is going
to be the user that logs in.
So just make sure that you actually call does get up user, because if you will call this user, then
it's not going to make sense a little bit later on.
So I'm gonna go at GitHub GitHub user and then we're gonna have our functions.
So set GitHub user and that is going to be equal to R use state.
OK.
Now the way you state hook works is we need to have some kind of default value, which in our case is
going to be mock user and then it returns an array with two hours with the actual value, whatever we
passed in as a default and then the function that allows us to change it.
So this is going to be our default value.
That's going to be our mock user, which now is stored in the get up user.
But later, when we performed the Fetch request, of course, we are going to use this said get Abuzer
to change that value.
And now we want to do the same thing for repos for the followers.
And then, of course, eventually I also want to pass it into the value.
Correct.
So, again, we have used that hook that returns an array with two values.
We have the actual value, the default one that we're currently passing in, as well as the function
that changes that value.
So copy and paste.
Two more times.
And we're looking for the repos.
The name is going to be repos and land function.
Name is set repos, set repos, of course.
And then we're using not a mock user.
We're using Mark and or EBOs and the same thing I would want to do for the followers.
So in this case, I'm going to change this to a follower's.
All are worse than set followers, of course, set followers.
And then after that, I would want to assign it to my followers that I'm importing.
So the oray with all my followers, let's save it.
We have three rulers right now.
And, of course, we're going to get a big, fat error because I typed here followers, but it should
be mark followers like.
So let me fix that up.
Now I have Moch followers.
And now want access these three things all throughout my application.
Now how I can access that while of course I wouldn't want to change my value to an object because at
the moment it is a string of hello.
So I say within a value I'm going to have an object.
And in that object, I'm going to have a properties and we can simply use the ESX syntax where even
the property name is equal to a variable name that has the value.
Well, I can just write only the property name.
So, for example, if I have GitHub user, I can either set it up equal to my get up user state value.
Like we have over here, or we can just limit that, we can say, alright, just get me to get up.
Years are the same thing I'm going to do for repos as well as the followers.
So this is what we're providing.
And of course, the moment we said we should get some kind of different information in the user info
because now we don't have the string anymore.
Correct.
So now we have our Mogg data.
So the static data that we're using on our value is an object.
It's not a string anymore, of course.
Let's navigate back to a info.
And in this case, I wouldn't want to display data.
I would just want to console Log-in what we're getting back into there.
So I'm going to both console log data and we should see something really, really cool.
So help me navigate to a bigger browser window.
Can I have the console?
Then I have a bunch of warnings and all that.
Please ignore them.
And then this is my giant object.
And in that giant object, I have my followers.
So that is my static data that is coming from the mock followers.
I have my GitHub user, which of course right now is was boss, because I used my Yooralla, not just
change the value.
So if you want to do that.
Do that, of course.
And then the last thing that I have are my repos.
So that is that giant array where each and every repo is that object.
So what's really cool is that now we can start pulling that data out.
So if I'm looking, for example, at my info, so I'm not looking at the search, I'm not looking at
Naba, I'm looking at the info.
What I would want?
Well, I would want the information from the user object.
So if I check my user object, the GitHub user object, I'll see that I have all this data.
I have the followers are how the following and all that good stuff.
So this is what we'll do starting from next video where one by one will work on our components.
We'll pull out of that static data and we'll display so well that that is gonna be the info.
There is gonna be card.
And whether that is gonna be the charts with our report information.
And again, the reason why we're doing that, because we're getting only 60 requests per hour and Eve
will fetch our data first as we're developing.
We're gonna waste them in no time.
So that way you would need to stop and start pretty much every hour because you'll waste those reports.
If we have the static data, that means that we can build up our whole application and then only eventually
hook it up to our fetch water, for example, once we fetch.
We just change these values, because at the moment, if you'll notice in the context, I have set up
user reports and followers, too, you can already imagine that eventually there is going to be an AJAX
request where we get that particular user we're looking for and we're just going to change these values.
So these are gonna be our default values that will always display wants the application loads.
So this is a good case where you can showcase your own GitHub profile.
So if somebody visits your application, you're displaying what you're doing on them.
And then.
He or she can search for a different user.
Hopefully this makes sense.
Starting from next video, we'll work on our user info component.