In this part we are going to talk about the facts data.
With youth we do so.
So often we create this new brand culture.
We are going to import the axles so we are going to install the axles.
So we need to type npm install a field that's that safe and then we did the unnecessary code and then
we import that we add and you the iPad and also use it as a thumb that we add and then we import the
exiles from exhales.
Next we are going to create a initial state which contained loading areas and also the to dos since
we are going to flash the to do list from the takes on place holder.
And then we are going to create a reducer which is equal to the state actions
and as we already can expect.
There are two cases that we are going to deal with.
One is where and fresh data is fashion successfully.
So we have to separate that data.
So what we named as stack data is any road that you want or named it.
We do not need brick because after we turn something.
So in this case as we go into a set the loading to be false.
We can copy this one and paste it here.
We started to force and to do we said Ashton dot Palo the action pay payload will be fashioned it from
using the axles and the order.
Is there something wrong when we flash the data.
So we have to start era again.
We have to return something
the loading again is false and the era we type it some eras and it reduced because we cannot fetch anything.
We did it at an empty away and last default.
What do we have do we tend to accrue and stay and then we can go to the app we go to use the use we
would give her.
And then we pass that we do it out here and initial stay and then create a state and also the dispatch.
So now we are going to fetch data and we have to use that use if at if we type that trace on pace over
there to do this.
We already get a API which already can see the trees on.
So we use these API.
And back to our app.
And then if we can successfully flash the data we have to dispatch the assertion that we just defined
it is does that data and it will be a Jason object and that type is that data and the PLO is west of
data and data dispatch the type in that era and since we already started era we do not have any pay
though here.
We do not have any dependency so we only just fetch it once.
Now we can start the app and see whether we can fetch the data we type NPM stock in order to show the
data we have to type the console load and rest our data.
Now as you can see we already can fetch the data and it already displayed it in the console.
No way you can do some conditional rendering if the state thought loading is equal to true then we are
going to type the loading here.
Otherwise we are going to rear ended the lease.
But to be more convenient we are going to create this mockup and we set it here.
For example we are going to create a save to check it red rug.
Also we are going to check whether today's era if there is ever and we are going to display the era.
Otherwise no.
So you'll see if these can fetch the data it will show the least up and if we try to type something
wrong
you will see it there are some errors here.
As you can see this is not a fairly good representation because the least markup and the errors.
So both together so to create in a more elegant way is to copy this one and then we paste it here.
So you said that if they is loading that we route display the loading.
Otherwise we would check whether use error if days era it will display the errors otherwise it should
be showed a list markup.
Now you can see the list markup disappear and if we back to here and
we correct this one it kind of show the data and there is no error here.
And just the least markup is being shown in the web page.
Now we can do some modification of the lease markup and if we get the data which means that we have
the state not reduce.
So we have stayed out to reduce thought map and then we have to do
and then we create a loose wheel and we get it to do it on title.
And the key is equal to to that I.D..
Now we read back to the patient you can see the to do title already displayed it here.
So that is how to first date data with use.
We deal with a.