Let's get started on this implementation.
We're going to first begin by creating some action types and then define the interfaces for for some
different actions that we will eventually dispatch as well to back inside my editor.
I will find inside my state directory the Action Types Index dots file inside of our enum.
We'll add in two new action types.
One will be bundle start.
And bundle complete.
All right, simple enough.
Next up, we'll go over to our actions inducts file.
So inside of here, we'll make two interfaces, one to describe the kind of action we're going to dispatch
any time a bundle is first started and any time a bundle is completed, we'll go down towards the bottom
of the file and right above our export type action.
I'll add in a new.
Interface and export it or bundle.
Start action.
Naturally, it will have a type of action type dot when they'll start, and then we do need to think
just a little bit about the payload here.
Do we need to provide any information describing the fact that a bundle was just started?
Well, remember, the entire idea behind this bundle start action is that we might eventually want to
show some sort of loading spinner on a code cell or maybe the preview window itself, if it ever takes
a long time to create a bundle for a particular cell.
So we need to figure out exactly which cell is actually being bundled.
So that implies we need to communicate along with this action exactly what cell we are bundling.
That means, well, we need to pass along the cell ID.
So I'm going to provide a payload of cell ID.
That will be a string.
OK, so then after that, we will export.
A second interface.
Or Bundall, complete action.
This will have a type of action type bundle complete.
And I just realized I misspelled complete, so I'm going to go back over to my definition.
I here and fix up that spelling.
There we go, much better.
Complete.
And fix up the spelling right there.
OK, so then same thing here as well, we need to think about exactly what our payload is going to be.
Well, very similar.
Whenever we complete a bundle, we really need to know which cell we just finished the bundling for
because we might eventually have many different code cells all being bundled at the exact same time.
So we probably want to provide the cell ID.
And then we probably also want to provide the output of the bundling process, as well as a quick reminder
of what we get out of that entire bundling process, we can go back to our Sarsae bundler index sites
file.
So inside of here, this is our bundling function.
And if we go down towards the bottom again, remember, the output is going to be an object with a code
property and an air property in both.
Those are going to be string's.
So as a part of our payload, I'm going to say that this is also going to contain a bundle.
It will have a code property that is a string and an air property that is a string as well.
All right, last up at the bottom of this file, remember, we need to combine together all these different
actions, so I'm going to remove the semicolon at the end of that line and then we'll put in a bundle
start action.
Bundle complete action.
And that's it.
OK, quick pause right here.
When we come back, the next video, we'll start doing some initial implementation of our actual bundles
reducer.