Let's go ahead and create a couple of different files and folders to store our action type in them,
these action types, all this good stuff.
So inside my state directory, I'm going to first begin by creating a new folder called Actions.
Inside, they're going to make a new file called Index Dots, so inside this file, we're going to place
all of our different interfaces that describe the different kinds of actions that exist inside of rap.
So I'll go back over to my producer.
I'm going to take everything from search repositories, action, this interface right here all the way
down to our type of action.
I'm going to cut all that.
And then paste it into that new index doctor's file.
I'm going to make sure that I export this type of action down here because we eventually want to use
this kind of multi type thing down here in several other locations.
We are getting an air around action type.
We'll pick that up in just a moment.
But right now, I'm going to save this file.
Then back inside my state directory, I'll make another new folder of action types inside there, I'll
make a new file of index dots.
Inside my producer, I'm going to find our action type Inam.
And then paste it into the new action types index dots file.
I'm also going to make sure that I export this as well.
OK, so let's now fix up a couple of different import statements and whatnot first instead of actions
inducts.
I'll go up to the very top and import action type from up one directory, one directory action types.
Then inside of my repositories reducer.
At the very top, I will import.
Action type from up on directory action types and action from up directory actions.
Now we've got a much better structure now the only thing that we might want to change for this structure,
as our application starts to grow in size, all of our different action types can always be added into
this action types index dots file.
So this enum can start to collect many more different action types over time, even if we start to add
in massively different parts of redox functionality to our application.
So if we start to add in many different kinds of reducers and whatnot and we start ending up with many
different kinds of action types, we would continue to add them all into this enum.
If we start to add in many different kinds of actions, that means that for every different action we
would want to add in another interface.
We could start to create some additional files inside this action directory.
For example, if we wanted to kind of extract all this stuff around repositories and whatnot, we could
create a repositories file inside the actions directory and then move these three interface definitions
inside there.
And that would just allow us to add in many, many more interfaces over time while keeping our code
structure fairly clean.
So that's how we could very easily expand this kind of pattern.
OK, so this all looks good.
It's now the last big thing we really need to do is take care of our actual store setup.
We also need to make sure that we eventually create an action creator that will be responsible for actually
making that request over to the API and then eventually dispatching an action of type search repositories
or success or whatever else.
So let's take care of these last couple of steps in just a moment.