1
00:00:01,280 --> 00:00:02,560
All right, the last thing I want to talk

2
00:00:02,560 --> 00:00:05,430
about real quick is aggregating modules.

3
00:00:05,430 --> 00:00:08,180
So, one of the things we want to do is

4
00:00:08,180 --> 00:00:10,440
make sure our modules are compact and

5
00:00:10,440 --> 00:00:12,390
they're tight, but at the same time I

6
00:00:12,390 --> 00:00:14,900
don't want to have to import a whole bunch

7
00:00:14,900 --> 00:00:16,450
of different things. And let's look at

8
00:00:16,450 --> 00:00:18,330
what this looks like. If I come back over

9
00:00:18,330 --> 00:00:23,010
to app.js, right now we've pulled out our

10
00:00:23,010 --> 00:00:25,735
sessionRepository and our template both,

11
00:00:25,735 --> 00:00:29,490
and we're going to use sessionRepository

12
00:00:29,490 --> 00:00:31,630
right here in getSessions, when we do the

13
00:00:31,630 --> 00:00:33,630
imports, that's where that's got to go.

14
00:00:33,630 --> 00:00:35,110
But then up hear we're also using

15
00:00:35,110 --> 00:00:38,730
sessionTemplate and we pull that out to

16
00:00:38,730 --> 00:00:42,340
template.js, and so now I have to import

17
00:00:42,340 --> 00:00:44,230
two things. I have to import from

18
00:00:44,230 --> 00:00:47,280
sessionRepository and I have to import the

19
00:00:47,280 --> 00:00:49,680
template. So what I want to do, as said,

20
00:00:49,680 --> 00:00:52,070
is just import everything from the one

21
00:00:52,070 --> 00:00:54,450
thing, from sessionRepository. So, what

22
00:00:54,450 --> 00:00:56,040
we're going to do when we do that is come

23
00:00:56,040 --> 00:00:59,460
back over here to sessionRepository, and

24
00:00:59,460 --> 00:01:04,390
then I can actually just export my

25
00:01:04,390 --> 00:01:10,450
sessionTemplate right here and then have

26
00:01:10,450 --> 00:01:13,060
it all come together. Now, template.js

27
00:01:13,060 --> 00:01:16,410
does not get added to scope for

28
00:01:16,410 --> 00:01:18,200
sessionRepository in any way. Like, I

29
00:01:18,200 --> 00:01:20,330
can't access that anywhere, it's not an

30
00:01:20,330 --> 00:01:25,010
import. But I can just say hey, also in

31
00:01:25,010 --> 00:01:27,170
addition to exporting getSessions and my

32
00:01:27,170 --> 00:01:30,120
sessionURL, also export sessionTemplate

33
00:01:30,120 --> 00:01:32,450
from this other thing over here. And this

34
00:01:32,450 --> 00:01:35,640
allows me to keep what's being imported

35
00:01:35,640 --> 00:01:38,870
into app.js very minimalistic and tight.

36
00:01:38,870 --> 00:01:41,270
I'm just importing the one thing from that

37
00:01:41,270 --> 00:01:43,080
one section, and that's all that I'm

38
00:01:43,080 --> 00:01:48,710
importing. Okay, now I've got all my

39
00:01:48,710 --> 00:01:51,790
exports, so let's summarize just real

40
00:01:51,790 --> 00:01:58,000
quick and then let's go build some imports.

