1
00:00:01,070 --> 00:00:06,560
Let's add in some implementation for both these cases will first begin with bundle, start to unbundle,

2
00:00:06,560 --> 00:00:11,060
start, we're going to take a look at our current state object and we're going to make a direct mutation

3
00:00:11,060 --> 00:00:13,520
for it inside of our state object.

4
00:00:13,670 --> 00:00:17,390
I'm going to look up the current cell that this action is talking about.

5
00:00:17,990 --> 00:00:22,550
So we're going to look up action haloed cell ID.

6
00:00:24,620 --> 00:00:29,900
That's going to give us essentially access to that property right there in this case, we do not really

7
00:00:29,900 --> 00:00:31,750
want to make any change to that existing object.

8
00:00:31,760 --> 00:00:33,440
We want to assign an object to it.

9
00:00:33,770 --> 00:00:36,800
We want to say, look at that cell inside of our state object.

10
00:00:38,170 --> 00:00:42,100
And we want to force it to have a new value of loading, true.

11
00:00:44,120 --> 00:00:50,450
Ode of empty string and air of empty string to the thought process here is that any time that we see

12
00:00:50,450 --> 00:00:54,470
a bundle start, we want to throw away the existing bundle if one exists.

13
00:00:54,760 --> 00:00:59,900
So if we have any existing code, any existing air for this particular cell, then let's just throw

14
00:00:59,900 --> 00:01:03,080
it away and we're going to update loading to true to say we are processing.

15
00:01:03,080 --> 00:01:05,060
We are about to create a brand new bundle.

16
00:01:06,600 --> 00:01:09,420
So we can do something very similar for Bundle Complete as well.

17
00:01:10,320 --> 00:01:13,830
We'll do a state action, Haloed Cell ID.

18
00:01:16,210 --> 00:01:22,090
We'll sign that an object directly give it a loading of false, because we have now completed our bundle,

19
00:01:22,090 --> 00:01:23,020
not loading anymore.

20
00:01:24,680 --> 00:01:31,280
And then our code and air properties are going to come out of the action payload, so action payload

21
00:01:31,280 --> 00:01:36,320
and I remember we said that it would have a bundle property and on there would be the code and air.

22
00:01:36,320 --> 00:01:38,390
So the output of our entire bundling process.

23
00:01:39,370 --> 00:01:45,040
We'll do code in that case and then for air will sign action, elude, bundle their.

24
00:01:46,890 --> 00:01:47,730
And that should be it.

25
00:01:49,010 --> 00:01:51,190
So pretty easy implementation in this case.

26
00:01:52,750 --> 00:01:57,760
Well, last thing we really need to do for this reducer is go over to a reducers index Staats file,

27
00:01:58,000 --> 00:02:01,200
and we need to make sure that we just wear this up to our combined reducers call.

28
00:02:01,930 --> 00:02:05,470
So the very top, we'll import bundles reducer.

29
00:02:06,910 --> 00:02:08,199
From bundles reducer.

30
00:02:10,130 --> 00:02:12,650
Well, then use that to define a bundles piece of St..

31
00:02:17,360 --> 00:02:22,670
OK, so that is it for our reducer, at least right now, unless we end up with any errors, we need

32
00:02:22,670 --> 00:02:23,930
to come back and troubleshoots.

33
00:02:24,470 --> 00:02:28,970
The last thing we really need to take care of on the right side of things is to create two different

34
00:02:28,970 --> 00:02:34,250
action creatures, or maybe in this case, just one, maybe one action creature that will dispatch initially

35
00:02:34,250 --> 00:02:36,140
an action of type one will start.

36
00:02:36,140 --> 00:02:40,640
And then when the bundle is complete, dispatch a second action of Bundall complete.

37
00:02:41,470 --> 00:02:46,360
So let's take care of these action creators or maybe again, just one action creator in just a moment.

