Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,150 --> 00:00:05,760
In the last lecture, we have worked on the changes in our story in this lecture will continue with
2
00:00:05,760 --> 00:00:07,260
further improvements.
3
00:00:08,370 --> 00:00:13,710
Let's start in earnest or index dogs and let's inspect what we are doing currently.
4
00:00:14,650 --> 00:00:19,000
When we get to the exchanges, we are setting time out to one second after one second.
5
00:00:19,180 --> 00:00:25,150
We are getting the state of the exchanges and there are setting them to our exchanges right to their
6
00:00:25,150 --> 00:00:25,570
values.
7
00:00:26,800 --> 00:00:32,320
What I would like to change here, I would like to separate to this step of the state exchanges to its
8
00:00:32,320 --> 00:00:33,280
separate function.
9
00:00:33,760 --> 00:00:40,780
OK, in the view, which is nicely modular package, we can separate every step of the functionality.
10
00:00:41,080 --> 00:00:46,690
We can have a separate functionality to get exchanges, and we can have a separate functionality to
11
00:00:46,690 --> 00:00:48,610
set of exchanges to the state.
12
00:00:49,480 --> 00:00:55,510
OK, so everything is nicely modular, everything is nicely testable, and we can easily easier to find
13
00:00:55,780 --> 00:00:56,800
issues in our code.
14
00:00:58,160 --> 00:00:58,820
OK, so.
15
00:00:59,870 --> 00:01:01,190
A part of the action here.
16
00:01:01,550 --> 00:01:03,650
You have something called mutations.
17
00:01:03,920 --> 00:01:08,570
Mutations like this, you know, specify your object and enter this object.
18
00:01:08,570 --> 00:01:10,760
You can specify your mutations functions.
19
00:01:12,370 --> 00:01:17,080
In this case, my mutations function will be to set up exchanges to send them to the state, so we will
20
00:01:17,080 --> 00:01:20,920
separate state here, upsetting of the exchanges of the state into the mutation.
21
00:01:22,180 --> 00:01:28,750
OK, so usually you are calling these functions you are fixing with a set such as, for example, set
22
00:01:29,140 --> 00:01:29,890
exchanges.
23
00:01:30,940 --> 00:01:31,450
All right.
24
00:01:31,910 --> 00:01:33,850
I specified as a normal function.
25
00:01:35,040 --> 00:01:39,720
Mutations are special mutations that they are receiving, not the entire context as they are, but they
26
00:01:39,720 --> 00:01:43,980
are receiving higher states, so the first parameter here will be always state.
27
00:01:44,700 --> 00:01:50,940
And the second parameter here will be the any value and a payload you will send through the comment
28
00:01:50,940 --> 00:01:53,310
function, but I will show you a into in a second.
29
00:01:54,240 --> 00:01:58,860
So remember, in the mutations, you will always have a first value, the state, a second value is
30
00:01:58,860 --> 00:01:59,820
your custom value.
31
00:02:00,030 --> 00:02:01,890
You can decide what it's going to be.
32
00:02:03,060 --> 00:02:08,010
So in this case, we can parse here data and you can call it data or we can call it normally exchanges.
33
00:02:09,000 --> 00:02:09,420
OK.
34
00:02:09,810 --> 00:02:13,770
And since we have a state here, we can just do this exactly the same thing, what we have done here,
35
00:02:15,180 --> 00:02:17,490
state exchanges, equal exchanges.
36
00:02:19,130 --> 00:02:25,700
This way, I don't think, but because they're a state to manipulate a state here at all I can is something
37
00:02:25,700 --> 00:02:26,510
called comet.
38
00:02:27,290 --> 00:02:32,600
OK, I gave him the context to me because we can see that comet function comet like this.
39
00:02:33,290 --> 00:02:39,140
So as we have learned so far, we have a context here, context and for context, the color of a state
40
00:02:39,140 --> 00:02:40,130
and also comet.
41
00:02:41,780 --> 00:02:45,920
Now they are working with a comet, and in the comet, he will specify following a comet.
42
00:02:46,910 --> 00:02:50,810
Any little specified here the name of your mutation you would like to call.
43
00:02:51,320 --> 00:02:57,140
In this case, we would like to call set exchanges and the payload you would like to send, and that
44
00:02:57,140 --> 00:03:01,370
will be the exchanges here when our data exchanges here.
45
00:03:02,090 --> 00:03:03,980
And that's the entire functionality.
46
00:03:04,880 --> 00:03:06,110
So not much change, guys.
47
00:03:06,110 --> 00:03:10,970
But if it changes, like with architecture, yes, you know, separating the setting of a state and
48
00:03:10,970 --> 00:03:11,960
the getting of that state.
49
00:03:13,070 --> 00:03:15,890
So after one second, here we are executing at a comet.
50
00:03:16,460 --> 00:03:20,240
We would like to call this at exchanges and passing the payload of the exchanges.
51
00:03:20,720 --> 00:03:23,750
These will execute mutations whatever you directly will pass.
52
00:03:24,230 --> 00:03:29,510
For us here as state exchanges, we are positioning ourselves as we want.
53
00:03:29,540 --> 00:03:35,450
Of course, you can collect data, we can call it early and call it the list of exchanges, whatever
54
00:03:35,450 --> 00:03:36,740
you prefer here.
55
00:03:37,700 --> 00:03:40,540
And then if you will look at the hard data and then it will send the data here.
56
00:03:40,550 --> 00:03:42,260
But I would like to call it exchanges.
57
00:03:43,810 --> 00:03:47,530
OK, and the same step here we're getting we are setting the exchanges to exchanges so many of us to
58
00:03:47,530 --> 00:03:50,230
go to your browser refresh after one second.
59
00:03:50,580 --> 00:03:53,860
The time of the one second you will receive your exchanges.
60
00:03:54,280 --> 00:03:57,430
And that's basically to just a just a small refactor.
61
00:03:57,910 --> 00:04:02,590
So you will learn how to use these things and you look at professional and as you will see in the end
62
00:04:02,590 --> 00:04:04,660
of the course, because we'll be using it heavily.
63
00:04:04,940 --> 00:04:06,670
So guys, let's see what the next well.
6291
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.