All right, my friends, that's it for this project, so I want to wrap up on it very quickly, a couple
of big items I really want to point out around some kind of awkward points when we start working with
Redux in typescript together.
And some of this is not from Redux directly.
Instead, it might be from the React Redux Library.
The first thing I want to point out is that we did a really kind of precise job of segmenting off a
lot of different things inside of separate directories, whereas previous redox projects you might have
worked on with just JavaScript, sometimes combined stuff like action types, action creators and actions
all into one single file.
So we created all these separate directories just to make sure it was really crystal clear what was
important, what what was exporting what and so on.
We also made sure that whenever we needed to get access to some redox related stuff from our REACT application,
we made sure that we imported all that stuff from the root index file inside that state directory.
So that was here's the state directory index that's right here.
We did not import anything directly from files or folders inside of state.
Instead, all of our imports for redox related stuff were coming from index.
Yes, right here.
Next up, we saw that communicating some type information over to our components could be a little bit
challenging, and that's where I kind of ranted for just a little bit.
I apologize for that rant to just a little bit around how we had to write out just that extra little
bit of code to communicate some type information about the structure of data inside of a redock store,
over to react redux.
There's not much more to say than that.
Pretty much.
If you want to make use of TypeScript and react redux together and use that, you select your hook.
Pretty much you're going to want to create a file that looks like this right here.
And then finally, last thing I want to mention, we didn't really go too much into depth or too much
in depth on some the type definition filed for and react redux.
But if you start going into those type definition files, in some cases, they're kind of like this
type stuff, just a little bit overengineered to reading those type definition files is sometimes a
little bit challenging.
One thing that we kind of sidestep here in particular.
I want to point out, was inside of our Action Creators Index file, we made use of an import directly
from Redock.
So we imported the dispatch type from Redux.
And we use that to apply a type to the dispatch function right here.
Another way that we could have accomplished this was by importing.
Redux thunk, I'm going to write that out like so and then do a command click on Redux Thunk and will
take us to the type definition file for Redux Thunk.
So inside of here are a couple of different types to describe action creators that we might write out
using Redux Thunk.
So these are pretty much types that we would apply to like search repositories itself are going to be
honest with you.
Understanding what these types are doing is really challenging and debatably maybe just a little bit
overengineered, you might say.
Kind of.
So using the redux type definition files is kind of challenging.
So a workaround is to either just say I'm going to annotate everything is any not really recommended.
So you can either try to kind of break things down into smaller types, which is what we really did
by importing dispatch from Redox.
Or alternatively, it is also technically possible to write out our own types to describe a lot of things
that are going on here.
So that's it, just some high level items I want to mention very quickly around this project.
That's pretty much it for Redox and TypeScript.
Let's take a pause right here and move on in just a moment.