Let's add in some implementation for both these cases will first begin with bundle, start to unbundle,
start, we're going to take a look at our current state object and we're going to make a direct mutation
for it inside of our state object.
I'm going to look up the current cell that this action is talking about.
So we're going to look up action haloed cell ID.
That's going to give us essentially access to that property right there in this case, we do not really
want to make any change to that existing object.
We want to assign an object to it.
We want to say, look at that cell inside of our state object.
And we want to force it to have a new value of loading, true.
Ode of empty string and air of empty string to the thought process here is that any time that we see
a bundle start, we want to throw away the existing bundle if one exists.
So if we have any existing code, any existing air for this particular cell, then let's just throw
it away and we're going to update loading to true to say we are processing.
We are about to create a brand new bundle.
So we can do something very similar for Bundle Complete as well.
We'll do a state action, Haloed Cell ID.
We'll sign that an object directly give it a loading of false, because we have now completed our bundle,
not loading anymore.
And then our code and air properties are going to come out of the action payload, so action payload
and I remember we said that it would have a bundle property and on there would be the code and air.
So the output of our entire bundling process.
We'll do code in that case and then for air will sign action, elude, bundle their.
And that should be it.
So pretty easy implementation in this case.
Well, last thing we really need to do for this reducer is go over to a reducers index Staats file,
and we need to make sure that we just wear this up to our combined reducers call.
So the very top, we'll import bundles reducer.
From bundles reducer.
Well, then use that to define a bundles piece of St..
OK, so that is it for our reducer, at least right now, unless we end up with any errors, we need
to come back and troubleshoots.
The last thing we really need to take care of on the right side of things is to create two different
action creatures, or maybe in this case, just one, maybe one action creature that will dispatch initially
an action of type one will start.
And then when the bundle is complete, dispatch a second action of Bundall complete.
So let's take care of these action creators or maybe again, just one action creator in just a moment.