Well that's pretty much it.
We finished this application before we move on I want to do a quick review of some very important concepts
that we covered inside this application.
I'm inside the actions index dodgiest file where we created in action creator to fetch weather from
our open weather API inside of here.
We made use of a constant declared type for our action.
We made this constant action right here so that we would not risk making any typos.
Between defining our typewrite here and when we actually used it inside of our producers file.
In addition inside of our action creator we made use of redux promise which is a middleware that allows
us to return a request excuse a promise on payload property right here.
When we return a promise on this Paillard property redux promise is going to automatically wait for
that promise to resolve.
Then once it does it'll take the data that the problem is resolved with.
It'll replace the request right here with that data and then it will send the action on to our reducers
in your own applications that you start to work on in the future.
I really expect that you'll probably end up making use of redux promise any time you need to make some
type of Ajax request.
Now the next big thing that we tackled inside this application was our weather reducer which was used
to store all the data that we fetch from the outside API.
The big lesson here was that we wanted to make sure that we never mutated existing state.
So any time an action came in that we cared about we would make sure that we returned a completely new
array rather than modifying the existing array that we already had the line of code that you see right
here where we create a new array we add in a single new record and then add in all the previous records
what we have is a very common pattern and it's something that you're going to see very frequently when
you start working on your own redux projects as well.
And the last big thing I wanted to mention was our Google Map component right here.
So inside of our Google Map component we made use of 3x ref system in order to get a direct DOM reference
to this div right here that was rendered in our browser.
We then fed that ref off to the Google Maps library which was to render an actual library I-frame or
see a map I-frame on the screen which made the user think that Yup we've got this map sitting right
here and they could see the actual city appearing.
So this was a good use or a good example of how we can still use third party libraries such as Google
maps inside of a re-act application.
And that's pretty much it.
Now there's still a lot for us to learn about redux and react.
So let's take a quick break right here.
And in the next section we'll get started on our next application.