1
00:00:00,970 --> 00:00:05,530
Let's go back over to our code editor, we're going to update that selector and add in some non-working

2
00:00:05,530 --> 00:00:06,790
copies of the show function.

3
00:00:07,660 --> 00:00:13,210
OK, so back over here, here's our cumulative code array and here's the copy of the show function that

4
00:00:13,210 --> 00:00:14,230
actually works.

5
00:00:14,230 --> 00:00:15,190
It actually does something.

6
00:00:15,740 --> 00:00:17,230
I'm going to take this entire string.

7
00:00:18,990 --> 00:00:21,870
So there's the entire multiline string, I'm going to cut it.

8
00:00:22,820 --> 00:00:28,400
And then I'm going to piece that in right above our cumulative coterie, and we'll call it show funk.

9
00:00:29,340 --> 00:00:32,640
So your show function, I'm assigning it that multiline string.

10
00:00:34,190 --> 00:00:40,620
Then right after that, I'm going to declare another variable called Show Funk No.

11
00:00:41,810 --> 00:00:45,970
So the idea here is that show funk, no up, no OP stands for no operation.

12
00:00:45,980 --> 00:00:47,750
It doesn't do anything when it is called.

13
00:00:48,380 --> 00:00:52,570
And I'm going to define this as our show is an empty function.

14
00:00:53,390 --> 00:00:56,240
You'll notice I'm using the keyword here bar for declaring this array.

15
00:00:56,480 --> 00:01:00,920
The reason for that is that you can declare a variable with the keyword bar as many times as you wish.

16
00:01:01,220 --> 00:01:06,470
But if you would try to consistently or continually re declare a variable using const Aulet, you'll

17
00:01:06,470 --> 00:01:09,830
very quickly get an error message saying that this variable has already been declared.

18
00:01:10,520 --> 00:01:15,980
We do need to go back up to the original show function up here, make sure we find the const show right

19
00:01:15,980 --> 00:01:16,610
here as well.

20
00:01:16,820 --> 00:01:19,190
And I'm also going to update that to be var show.

21
00:01:21,790 --> 00:01:23,650
OK, so now down inside of our Falu.

22
00:01:26,150 --> 00:01:28,160
We're going to find our cumulative code right here.

23
00:01:29,600 --> 00:01:35,180
So if we have a code cell, we're going to take a look at the ID of the cell, we're going to see if

24
00:01:35,180 --> 00:01:39,530
the idea the cell is the one that we are trying to execute, if we are, then we're going to add in

25
00:01:39,680 --> 00:01:41,810
the real version of our show function.

26
00:01:41,960 --> 00:01:44,480
Otherwise, we're going to add in the no up version.

27
00:01:44,900 --> 00:01:47,270
We're going to say if ID.

28
00:01:48,370 --> 00:01:54,130
Is equal to sell dot ID, that means that this is the cell that we want to give a real version of the

29
00:01:54,130 --> 00:01:58,060
show function to put in a cumulative code that push.

30
00:01:59,200 --> 00:02:00,340
So unk.

31
00:02:01,380 --> 00:02:03,790
Otherwise, this must be a previous cell.

32
00:02:04,020 --> 00:02:07,230
We do not want to provide any kind of Runnable code here.

33
00:02:07,650 --> 00:02:12,120
We'll put in a cumulative OWD Bush show funk.

34
00:02:12,120 --> 00:02:12,600
No.

35
00:02:13,960 --> 00:02:18,640
Now, you will notice we're getting a little bit of an air here, that's just because I've left a comma

36
00:02:18,640 --> 00:02:21,780
inside of cumulative code right there to remove that in the air goes away.

37
00:02:23,930 --> 00:02:25,010
OK, that looks good.

38
00:02:25,430 --> 00:02:28,730
Let's save this, look back over and do a quick test.

39
00:02:30,670 --> 00:02:32,830
Now, back over, I'll do a quick refresh.

40
00:02:35,050 --> 00:02:38,710
And I should be able to do a show of an H1.

41
00:02:40,880 --> 00:02:43,220
That says hi there or whatever else.

42
00:02:46,160 --> 00:02:50,690
And then if I go down to the next code cell, I no longer see I there appear on the screen.

43
00:02:51,530 --> 00:02:56,180
So we only see this show in vote for the current preview window.

44
00:02:57,040 --> 00:03:00,490
I should be able to add in another showdown here with a totally different one.

45
00:03:02,180 --> 00:03:04,120
And say something else.

46
00:03:05,980 --> 00:03:07,240
And I still see that appear.

47
00:03:07,930 --> 00:03:12,880
I should also be able to add in some additional code cells and each one that I add in should not have

48
00:03:12,880 --> 00:03:18,760
any printouts or any show content inside of those until I start to add in a show for that very particular

49
00:03:18,760 --> 00:03:19,000
code.

50
00:03:19,010 --> 00:03:22,780
So I'll update this one to say middle.

51
00:03:23,020 --> 00:03:23,410
So.

52
00:03:24,700 --> 00:03:25,530
Yep, looks good.

53
00:03:26,790 --> 00:03:28,710
OK, well, that's pretty much it.

54
00:03:29,570 --> 00:03:32,810
Well, I think we've got a really good working version of the show function here.

55
00:03:33,370 --> 00:03:36,370
The last thing we really need to do is a little bit of code cleanup.

56
00:03:36,710 --> 00:03:42,350
So right now, this entire selecter is just very, very large and it's all inside of a code cell component.

57
00:03:42,920 --> 00:03:47,540
The last thing I really want to do is extract the selector into some other file just so we have one

58
00:03:47,540 --> 00:03:52,880
location for all this logic around finding the cumulative code for cell and then injecting all this

59
00:03:52,880 --> 00:03:54,470
show related stuff into it.

