1
00:00:00,730 --> 00:00:02,450
Let's get started on this implementation.

2
00:00:02,620 --> 00:00:07,689
We're going to first begin by creating some action types and then define the interfaces for for some

3
00:00:07,689 --> 00:00:11,920
different actions that we will eventually dispatch as well to back inside my editor.

4
00:00:12,070 --> 00:00:18,340
I will find inside my state directory the Action Types Index dots file inside of our enum.

5
00:00:18,340 --> 00:00:20,080
We'll add in two new action types.

6
00:00:20,230 --> 00:00:22,540
One will be bundle start.

7
00:00:24,940 --> 00:00:27,160
And bundle complete.

8
00:00:32,759 --> 00:00:33,720
All right, simple enough.

9
00:00:34,170 --> 00:00:37,140
Next up, we'll go over to our actions inducts file.

10
00:00:38,160 --> 00:00:43,410
So inside of here, we'll make two interfaces, one to describe the kind of action we're going to dispatch

11
00:00:43,410 --> 00:00:49,080
any time a bundle is first started and any time a bundle is completed, we'll go down towards the bottom

12
00:00:49,080 --> 00:00:51,720
of the file and right above our export type action.

13
00:00:51,960 --> 00:00:53,160
I'll add in a new.

14
00:00:54,210 --> 00:00:57,630
Interface and export it or bundle.

15
00:00:59,600 --> 00:01:00,800
Start action.

16
00:01:02,260 --> 00:01:08,020
Naturally, it will have a type of action type dot when they'll start, and then we do need to think

17
00:01:08,020 --> 00:01:09,890
just a little bit about the payload here.

18
00:01:10,180 --> 00:01:14,170
Do we need to provide any information describing the fact that a bundle was just started?

19
00:01:14,650 --> 00:01:18,910
Well, remember, the entire idea behind this bundle start action is that we might eventually want to

20
00:01:18,910 --> 00:01:24,700
show some sort of loading spinner on a code cell or maybe the preview window itself, if it ever takes

21
00:01:24,700 --> 00:01:27,290
a long time to create a bundle for a particular cell.

22
00:01:28,030 --> 00:01:31,870
So we need to figure out exactly which cell is actually being bundled.

23
00:01:32,200 --> 00:01:36,460
So that implies we need to communicate along with this action exactly what cell we are bundling.

24
00:01:36,530 --> 00:01:39,070
That means, well, we need to pass along the cell ID.

25
00:01:39,460 --> 00:01:41,950
So I'm going to provide a payload of cell ID.

26
00:01:42,250 --> 00:01:43,090
That will be a string.

27
00:01:45,170 --> 00:01:47,900
OK, so then after that, we will export.

28
00:01:49,390 --> 00:01:50,680
A second interface.

29
00:01:52,550 --> 00:01:54,530
Or Bundall, complete action.

30
00:01:55,750 --> 00:01:59,200
This will have a type of action type bundle complete.

31
00:02:00,240 --> 00:02:04,980
And I just realized I misspelled complete, so I'm going to go back over to my definition.

32
00:02:05,840 --> 00:02:07,740
I here and fix up that spelling.

33
00:02:08,449 --> 00:02:09,479
There we go, much better.

34
00:02:09,889 --> 00:02:10,520
Complete.

35
00:02:11,810 --> 00:02:13,360
And fix up the spelling right there.

36
00:02:16,530 --> 00:02:20,910
OK, so then same thing here as well, we need to think about exactly what our payload is going to be.

37
00:02:21,570 --> 00:02:22,590
Well, very similar.

38
00:02:22,590 --> 00:02:27,360
Whenever we complete a bundle, we really need to know which cell we just finished the bundling for

39
00:02:27,360 --> 00:02:31,410
because we might eventually have many different code cells all being bundled at the exact same time.

40
00:02:31,830 --> 00:02:34,710
So we probably want to provide the cell ID.

41
00:02:35,820 --> 00:02:41,070
And then we probably also want to provide the output of the bundling process, as well as a quick reminder

42
00:02:41,070 --> 00:02:46,840
of what we get out of that entire bundling process, we can go back to our Sarsae bundler index sites

43
00:02:46,860 --> 00:02:47,190
file.

44
00:02:47,850 --> 00:02:50,520
So inside of here, this is our bundling function.

45
00:02:51,180 --> 00:02:57,180
And if we go down towards the bottom again, remember, the output is going to be an object with a code

46
00:02:57,180 --> 00:02:59,160
property and an air property in both.

47
00:02:59,160 --> 00:03:00,390
Those are going to be string's.

48
00:03:02,940 --> 00:03:06,960
So as a part of our payload, I'm going to say that this is also going to contain a bundle.

49
00:03:08,600 --> 00:03:14,030
It will have a code property that is a string and an air property that is a string as well.

50
00:03:17,070 --> 00:03:21,450
All right, last up at the bottom of this file, remember, we need to combine together all these different

51
00:03:21,450 --> 00:03:28,080
actions, so I'm going to remove the semicolon at the end of that line and then we'll put in a bundle

52
00:03:28,440 --> 00:03:29,580
start action.

53
00:03:30,760 --> 00:03:32,740
Bundle complete action.

54
00:03:33,580 --> 00:03:34,320
And that's it.

55
00:03:35,980 --> 00:03:37,210
OK, quick pause right here.

56
00:03:37,210 --> 00:03:41,530
When we come back, the next video, we'll start doing some initial implementation of our actual bundles

57
00:03:41,530 --> 00:03:42,190
reducer.

