All right, my friends, as I mentioned, all this redux stuff is going to be just about identical to
what we went through earlier on inside the course.
So on this video, in the next couple, as we do some initial setup, we're going to pretty much speed
through all this stuff.
We're going to write out a lot of code, create a lot of different files.
And if you get confused at any point, you can always go back to those earlier videos on Redox and just
do a quick review on why we are taking the approach that we are taking.
So let's get to it to get started.
I'm going to first begin by creating inside my Sarsae folder a new directory called State.
Just as I said previously, if you don't like the name of state, you're totally fine.
You could rename this to whatever you want it to be.
Then inside of here, we will immediately create a couple of different files and folders.
I will immediately create a new file called Index Dots.
I will create a new file called Staats.
I will create a new folder called Action Creators.
A new folder called Action Types, another folder called Actions, and one more folder called Reducers.
OK, good place to get started inside of reducers will then create a new file called Index Dots.
I'll create another file of cells, reducer dots.
Another file of bundles, reducers, it's.
Then inside of our three different action folders, we'll make an index dots file as well, so inside
of action crater's index dots, inside of action types, index dots and guess what's going inside of
actions?
Yes, that's right.
Index dots.
OK, a lot of different files have now been created, if you get an error at any point inside of your
browser that says something about some kind of isolated module or a flag or an isolated modules, you
cannot just keep refreshing your server or anything like that to get it to go away.
If you see any air starting to appear in the next couple of videos, it is because we have a couple
of different types of files that are completely empty and create react up really wants to see content
inside of all these different files.
If you ever see an error message around that, you have to restart your server.
You can't just keep trying to add stuff into files and then try refreshing.
You have to restart the server entirely.
And again, you only have to do this if you start seeing some error messages around something like isolated
modules or something like that or something around expected something to export a value or something
like that.
So just a quick heads up that if you see that er you got to restart your development server.
All right.
So now we've got a lot of different files.
Let's first begin right away.
I think that will begin.
How about inside of our action types file.
Let's create a new enum inside there and then define some of the different action types that we will
probably need to build out some of our different actions and our different reducers.
Some inside of my action types index dots file.
Inside of here, I will exports an enum of action type.
And then right now, I really don't have any great idea about the different action types will need,
so I'm just going to reflect back on the diagram we were looking at just a moment ago and think what
different action types do.
We probably need to handle these different reducers.
Well, I see one about, say, update, cell delete, cell insert and move.
I think that we probably need one action type for each of these different action creators because each
of these action creators are probably going to eventually, you guessed it, create an action that's
going to look very similar or have a name or a type that is very similar to the name of the action itself.
So in other words, we probably want to have an action type of maybe move cell.
We probably want to have one of these elite cell.
Probably one of insert cell before and the reason on this diagram really quick, I put on here, insert
cell before or insert cell after is because we need to eventually decide if we want to have an action
here called insert cell before or insert cell after.
Essentially, do we want to have the ability to insert one cell after others or have the ability to
insert cell after others or both?
That's a discussion we're going to eventually have.
But right now we're just going to assume that we're only going to have the ability to insert one cell
before another cell will get into more detail on that in a little bit.
I'll do insert cell before.
And then finally was the last one, I think update cell is the last one, so update cell.
OK, so reasonable place to get started once again, we do, of course, need to have some kind of safe
cells, fat cells or something like that, but let's just worry about these very basic actions to get
started.
All right.
So this looks good.
Let's take a pause right here and come back in just a moment.