Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,360 --> 00:00:00,840
Hi, there.
2
00:00:01,170 --> 00:00:06,810
In the last lecture, we created function of exchanges, which it serves as a simulation of making a
3
00:00:06,810 --> 00:00:08,340
request to the network.
4
00:00:08,970 --> 00:00:12,090
In this lecture, we'll talk about modules.
5
00:00:12,900 --> 00:00:13,920
So what are modules?
6
00:00:13,920 --> 00:00:21,900
In terms of the UX, you will create a module to grow up similar functionality, such as, in this case,
7
00:00:21,900 --> 00:00:22,560
exchanges.
8
00:00:23,520 --> 00:00:24,090
I'll drop it.
9
00:00:24,090 --> 00:00:26,040
It'll be easier to understand.
10
00:00:26,080 --> 00:00:29,490
So currently we have only one UX, all right.
11
00:00:29,490 --> 00:00:33,940
So we have only one store and we are placing everything inside of this store.
12
00:00:33,960 --> 00:00:40,500
So later we can create multiple functionalities not only to get exchanges, but also to get user to
13
00:00:40,500 --> 00:00:45,360
get opportunities, as you will learn later and also the other types of data.
14
00:00:46,280 --> 00:00:52,080
Currently, with this architecture, what we have here, we have no other options displace everything
15
00:00:52,320 --> 00:00:53,800
into this one store.
16
00:00:54,030 --> 00:00:59,190
You can imagine how many mutations and how many actions and how much how much state we will have.
17
00:00:59,910 --> 00:01:00,540
Not very good.
18
00:01:01,200 --> 00:01:08,400
So what we'll do instead, if you look at a modularity, the store will have a couple of modules or
19
00:01:08,400 --> 00:01:10,110
can have multiple modules.
20
00:01:10,950 --> 00:01:12,680
In our case, they'll have a modules like this.
21
00:01:13,050 --> 00:01:13,500
You'll have that.
22
00:01:13,980 --> 00:01:15,570
We will have an exchange as module.
23
00:01:15,900 --> 00:01:17,550
We will have a user as a module.
24
00:01:17,820 --> 00:01:19,020
We will have an opportunity.
25
00:01:19,020 --> 00:01:19,650
Opportunities modules.
26
00:01:19,740 --> 00:01:30,180
OK, so like here X changes, we'll have that users and we will have opportunities of poor during the
27
00:01:30,900 --> 00:01:36,480
these and all of these modules will have their own functionality, their own states, all of them,
28
00:01:36,480 --> 00:01:43,470
they will have their own state owned state state here, their own actions, their own mutations and
29
00:01:43,470 --> 00:01:44,160
so on.
30
00:01:44,940 --> 00:01:47,130
So then through all of your component.
31
00:01:48,270 --> 00:01:49,170
What our home page.
32
00:01:50,580 --> 00:01:51,650
Can connect this store.
33
00:01:52,570 --> 00:01:55,450
And we can ask for any data from any module.
34
00:01:56,460 --> 00:02:01,980
So I can ask you in this case for a good exchange is right, we are at least pitching here to get exchanges.
35
00:02:04,530 --> 00:02:06,490
Exchange and Jess.
36
00:02:06,900 --> 00:02:13,680
All right, I will find the modules of these actions belong store and I will execute it, OK, in this
37
00:02:13,680 --> 00:02:15,810
case, not in this one of these needs one.
38
00:02:16,230 --> 00:02:17,010
But these are one.
39
00:02:17,070 --> 00:02:19,930
OK, or no excuse the action here.
40
00:02:19,930 --> 00:02:24,240
I will get the data back here, back here and I have data in my home.
41
00:02:25,440 --> 00:02:30,510
OK, so that's the modularity to not pollute the one file, create a separate file for every module.
42
00:02:30,720 --> 00:02:31,800
And that's basically it.
43
00:02:32,130 --> 00:02:33,480
That's the entire modularity.
44
00:02:35,840 --> 00:02:36,150
All right.
45
00:02:36,740 --> 00:02:41,210
So let's get a module's great open here, your files for the structure.
46
00:02:42,180 --> 00:02:46,920
It is thoughtful that I will create a new folder, I will develop call into modules and modules that
47
00:02:46,920 --> 00:02:49,710
will create our first module, which will call exchange.
48
00:02:50,100 --> 00:02:50,580
All right.
49
00:02:50,640 --> 00:02:58,140
You file in the modules and let's call it exchange module or exchange exchange dodgers.
50
00:02:58,140 --> 00:02:58,680
Perfect.
51
00:02:59,760 --> 00:03:04,770
But you will do you'll get your your index judges and basically all of this here is an exchange.
52
00:03:04,800 --> 00:03:07,620
So copy everything, control a select everything.
53
00:03:07,620 --> 00:03:08,370
Copy it.
54
00:03:09,030 --> 00:03:09,990
Go to exchange.
55
00:03:09,990 --> 00:03:12,780
Pass it here, OK?
56
00:03:13,170 --> 00:03:15,720
For every module you donate to create a separate store.
57
00:03:15,750 --> 00:03:17,420
You just need to create a story once.
58
00:03:17,460 --> 00:03:23,040
So what you are returning from a module is just a pure object so it can create store and you can enable
59
00:03:23,040 --> 00:03:23,880
his record here.
60
00:03:25,040 --> 00:03:25,410
It does it.
61
00:03:25,410 --> 00:03:26,910
Love your curly brackets for object.
62
00:03:27,390 --> 00:03:29,550
You will scroll down and you will remove this bracket.
63
00:03:29,580 --> 00:03:30,240
Also here.
64
00:03:31,880 --> 00:03:32,330
OK.
65
00:03:32,360 --> 00:03:32,900
Like this?
66
00:03:33,710 --> 00:03:38,750
OK and create started on it here as well, so you can remove, import, create, store and that's what
67
00:03:38,750 --> 00:03:40,430
you will have here on the exchanges.
68
00:03:40,430 --> 00:03:44,540
Such exchanges export default, empty object and this perfect.
69
00:03:46,170 --> 00:03:50,460
Now, people get back to your main module in technology as.
70
00:03:51,430 --> 00:03:53,200
And you can start with the removal process.
71
00:03:53,560 --> 00:03:56,800
You can enable go fetch exchanges, you can remove the exchanges here.
72
00:03:57,790 --> 00:04:02,020
If you leave here, only create store now, state if you don't need any stay.
73
00:04:02,020 --> 00:04:02,950
We don't need any actions.
74
00:04:02,950 --> 00:04:04,360
We don't need any mutations here.
75
00:04:05,200 --> 00:04:10,240
But what we need to define here will be the module module you'd like to reference here.
76
00:04:11,380 --> 00:04:12,430
So under the store?
77
00:04:13,080 --> 00:04:13,210
Great.
78
00:04:13,270 --> 00:04:14,440
So let's import here.
79
00:04:14,440 --> 00:04:21,520
Your first module, which is an exchange module, was your exchange from no need to find our modules
80
00:04:21,520 --> 00:04:21,700
there.
81
00:04:21,700 --> 00:04:24,460
So dot slash modules and exchange.
82
00:04:25,570 --> 00:04:31,990
Now in the Create Story, you will specify modules, property like this, and he will specify your first
83
00:04:31,990 --> 00:04:34,060
module, which is your exchange module.
84
00:04:35,490 --> 00:04:36,090
Amazing.
85
00:04:36,480 --> 00:04:37,140
And that's done.
86
00:04:38,280 --> 00:04:42,780
Your application of law not working out when you will go back to browser, you will see a refresh.
87
00:04:42,990 --> 00:04:45,600
There are no exchanges and I will inspect this.
88
00:04:45,900 --> 00:04:47,340
I should see here issue.
89
00:04:48,810 --> 00:04:49,470
OK.
90
00:04:50,010 --> 00:04:55,450
That's not the actual issue I am looking for, but basically invalid.
91
00:04:55,470 --> 00:04:59,760
Proper Typekit failed to for a proper exchange expected error by the code undefined.
92
00:05:00,030 --> 00:05:02,820
So you can see that we are not getting any exchanges.
93
00:05:04,370 --> 00:05:09,380
Go back to your calls and what's happening now in your home, the view, you're basically not accessing
94
00:05:09,410 --> 00:05:12,590
your global state of the story, but you need to specify your module.
95
00:05:14,320 --> 00:05:17,920
You need to specify your module and you need to access the exchanges on this module.
96
00:05:18,700 --> 00:05:21,580
So any values store state.
97
00:05:22,030 --> 00:05:23,110
Now the module name.
98
00:05:23,350 --> 00:05:28,030
So what is what is our module name, how we are calling our module?
99
00:05:28,540 --> 00:05:33,070
We can take a look in our index suggests and you can see we are calling our module exchange.
100
00:05:34,270 --> 00:05:41,470
So humbled of your access to our state, but you've all got your exchange to access the X Change module
101
00:05:42,910 --> 00:05:45,310
and on exchange you accessing the state of the exchanges.
102
00:05:46,260 --> 00:05:47,280
That's how it is now.
103
00:05:48,060 --> 00:05:49,050
So then you will save it.
104
00:05:50,220 --> 00:05:53,550
I'll go back here after one second, you will see your exchanges appearing here.
105
00:05:55,340 --> 00:06:01,580
OK, so one more time access store acts as a store of state on the state, acts as the module and on
106
00:06:01,580 --> 00:06:02,990
a module acts as your state.
107
00:06:03,680 --> 00:06:04,100
That's it.
108
00:06:05,900 --> 00:06:08,230
The naming here is not a very nice review.
109
00:06:08,370 --> 00:06:13,580
We'll take a look at the hero existing accessing a state exchange that exchanges are, that's not very
110
00:06:13,580 --> 00:06:14,700
clear what's happening here.
111
00:06:14,730 --> 00:06:17,690
We're not getting the single exchange under on the auction block.
112
00:06:17,900 --> 00:06:19,100
Access to exchanges.
113
00:06:19,430 --> 00:06:20,210
Not very good.
114
00:06:20,960 --> 00:06:21,590
What we can do.
115
00:06:21,590 --> 00:06:23,000
We can remove the state data.
116
00:06:23,780 --> 00:06:30,230
They are keeping on in exchange module so we can go to our modules, exchange dodges.
117
00:06:30,230 --> 00:06:33,710
And instead of calling it exchanges, let's go with the items.
118
00:06:33,710 --> 00:06:35,740
Let's say OK items.
119
00:06:35,960 --> 00:06:36,760
It's a much better name.
120
00:06:36,770 --> 00:06:39,440
In this case, we have your items.
121
00:06:39,440 --> 00:06:46,220
And instead of sitting here exchanges to state exchanges, which we don't have now, we have only state
122
00:06:46,220 --> 00:06:46,910
items.
123
00:06:47,340 --> 00:06:51,830
Will right here, state items and here equal exchanges.
124
00:06:52,490 --> 00:06:53,000
Perfect.
125
00:06:54,280 --> 00:07:00,550
Does the change and have your home told VOA to fix the computer that here so you need to agree or restore
126
00:07:00,850 --> 00:07:05,350
state exchange module on exchange module, you have no items.
127
00:07:06,190 --> 00:07:06,730
And that's it.
128
00:07:07,840 --> 00:07:08,710
Now they can save.
129
00:07:09,190 --> 00:07:10,090
We can check it out.
130
00:07:10,330 --> 00:07:15,040
And up to refresh after one second, if your days are appearing and in a console, there are no issues
131
00:07:15,940 --> 00:07:17,940
that's going to abate from this lecture.
132
00:07:18,080 --> 00:07:21,040
Let's go and do more changes in the next one year.
11456
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.