Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,420 --> 00:00:01,890
Hello, guys, welcome back.
2
00:00:02,040 --> 00:00:05,160
In the last lecture, we have successfully, I start to users.
3
00:00:05,520 --> 00:00:10,320
The functionality is prepared, it's working, but it requires some improvement.
4
00:00:10,530 --> 00:00:14,100
So let's continue this lecture and let's work on the improvement.
5
00:00:15,300 --> 00:00:17,790
OK, let's take a look on that page in the register page.
6
00:00:17,790 --> 00:00:23,790
And the one thing I don't currently like is that we don't know that we are registering the user we should
7
00:00:23,790 --> 00:00:24,210
display.
8
00:00:24,210 --> 00:00:26,010
Here is some indicator that we are registering.
9
00:00:26,010 --> 00:00:26,430
They use that.
10
00:00:26,490 --> 00:00:31,560
So for example, when the user is getting registered, I would like to disable this sign up button,
11
00:00:31,570 --> 00:00:35,510
so I would like to know Register is processing, OK?
12
00:00:36,480 --> 00:00:41,610
And also, I would like to maybe start the error into the state of the module so I can use it on my
13
00:00:41,610 --> 00:00:41,880
page.
14
00:00:41,880 --> 00:00:44,070
And maybe I can display here this error on the screen.
15
00:00:45,830 --> 00:00:47,390
So let's try to implement this.
16
00:00:48,580 --> 00:00:55,090
And let's start in their user module to start this information that they are processing the register
17
00:00:55,090 --> 00:00:59,590
and that we have an error of the need to, of course, create here some data we need to create here
18
00:00:59,590 --> 00:01:00,070
state.
19
00:01:01,420 --> 00:01:06,790
So you know how to create a stable does create a state function and you will return to state and the
20
00:01:07,140 --> 00:01:09,190
the data you would like to store in a state.
21
00:01:10,420 --> 00:01:12,940
What data we like to store would like to store here.
22
00:01:13,300 --> 00:01:20,430
I'll call it is processing and the error alerts by the register are industrial properties.
23
00:01:20,430 --> 00:01:25,540
So because in the inside here we can have a multiple states, right, so we can have a state register.
24
00:01:25,780 --> 00:01:28,750
Now these are what you are looking to have a steady state for logging and so on.
25
00:01:29,590 --> 00:01:33,730
So I would like to have a state for register and in register state.
26
00:01:33,730 --> 00:01:37,300
I would like to know if we are currently registering in our call.
27
00:01:37,300 --> 00:01:38,710
It is processing.
28
00:01:40,090 --> 00:01:44,020
I'll make it as a default, as a false and the error message.
29
00:01:44,580 --> 00:01:47,800
Will be searching and by default, this will be empty string.
30
00:01:49,550 --> 00:01:51,590
OK, perfect, so they have already stayed here.
31
00:01:52,980 --> 00:01:54,210
Now in our actions.
32
00:01:55,140 --> 00:01:55,790
Well, they want to do.
33
00:01:55,800 --> 00:02:00,030
We would like to tackle these states depending on our state of our education, so if they are, for
34
00:02:00,030 --> 00:02:04,140
example, getting authenticated, then they can set its processing is through.
35
00:02:04,320 --> 00:02:08,100
When that indication is finished, we can say it is processing is false.
36
00:02:09,000 --> 00:02:09,300
OK.
37
00:02:10,590 --> 00:02:15,060
But first, let's prepare three permutations, which will be responsible for handling this data changes.
38
00:02:16,200 --> 00:02:22,470
So it's better to two mutations meal days since I am actually in the wrong field, I guess.
39
00:02:22,500 --> 00:02:24,030
Let me see status here.
40
00:02:24,540 --> 00:02:25,440
Excellence is here.
41
00:02:25,470 --> 00:02:29,570
Yeah, here should be mutations after the actions should be meal.
42
00:02:29,940 --> 00:02:33,960
They shouldn't make sure you have your nesting at this property.
43
00:02:33,960 --> 00:02:38,370
So mutation has to be on the same level as the actions and at the same level as the state.
44
00:02:39,150 --> 00:02:42,030
Any mistake here can result into that issue.
45
00:02:43,520 --> 00:02:51,620
So mutations here and will call these mutations, said Preregister is processing, said the register
46
00:02:52,190 --> 00:03:04,430
is processing the other mutation will be set register error, set register error as you know, be mutations
47
00:03:04,430 --> 00:03:08,660
and mutation function will receive a state as the first value.
48
00:03:09,080 --> 00:03:14,360
The first argument, the second one will be the data are payload.
49
00:03:14,360 --> 00:03:15,050
We consent.
50
00:03:15,710 --> 00:03:21,200
So in the case of its processing, it will be is processing value in a case of an error.
51
00:03:21,590 --> 00:03:28,520
This will be an error of value and then simply connect to the state to the register that is processing
52
00:03:28,520 --> 00:03:31,940
and the US is processing the same bit here.
53
00:03:32,390 --> 00:03:38,570
State register does not error equal error like this.
54
00:03:39,700 --> 00:03:45,880
OK, so embarrassing state register is processing, so basically accusing state a register is processing
55
00:03:45,900 --> 00:03:50,800
and setting the value that I'm not sending right now, but I will be sending it very soon.
56
00:03:52,980 --> 00:03:54,600
As you can see here, we are getting here out.
57
00:03:54,870 --> 00:03:59,460
If you want to simplify, you just get to get out and simply get it here.
58
00:04:00,220 --> 00:04:01,030
OK, just call here.
59
00:04:01,050 --> 00:04:01,530
Get out.
60
00:04:02,130 --> 00:04:03,390
And this line can remove.
61
00:04:04,960 --> 00:04:11,320
Now, when somebody will call these pages that are immediately would like to set here, registries processing
62
00:04:11,320 --> 00:04:13,870
through natural disaster is is empty.
63
00:04:14,680 --> 00:04:20,870
So I hear comet meaning to the secretary's comet from the context of other comet able to commit here
64
00:04:20,890 --> 00:04:22,480
our actions, you can copy them.
65
00:04:22,720 --> 00:04:25,170
So first action transmutation would like to comet.
66
00:04:25,750 --> 00:04:27,310
It'll be said registries processing.
67
00:04:28,370 --> 00:04:32,480
I'll sit here and I will say I am processing register true.
68
00:04:33,820 --> 00:04:38,640
Then, Eleanor Comet, that set produced an error that register error.
69
00:04:40,240 --> 00:04:40,960
OK.
70
00:04:40,990 --> 00:04:45,490
And I will say here, this is empty error because they don't have any error yet.
71
00:04:45,490 --> 00:04:47,470
We are just starting the legislative process.
72
00:04:48,430 --> 00:04:49,420
This is just a cleanup.
73
00:04:50,140 --> 00:04:54,340
OK, so in the case, we got previously registered error and we want to register again.
74
00:04:54,640 --> 00:04:58,120
We would like to clean up the data, so register error will be empty again.
75
00:04:59,970 --> 00:05:02,910
OK, Elliot, we don't need a bill anymore to alert.
76
00:05:04,560 --> 00:05:09,220
What we'll do instead in the catch block here as a council error error message, we donate to council.
77
00:05:09,240 --> 00:05:10,950
Look, anything, I will remove it.
78
00:05:10,950 --> 00:05:11,730
I will committed.
79
00:05:11,730 --> 00:05:18,360
Rather, I will say here, said register error and will provide the error message.
80
00:05:19,920 --> 00:05:20,280
OK.
81
00:05:22,050 --> 00:05:26,750
And in the bottle, the case has been the catch, the error or going to be successfully registered,
82
00:05:26,750 --> 00:05:29,820
the user who would like to set its processing to false.
83
00:05:30,660 --> 00:05:33,000
You can handle this in the final block.
84
00:05:34,050 --> 00:05:39,000
Finally, Block is called always doesn't matter if you get error or you will be successful with the
85
00:05:39,000 --> 00:05:43,680
register, you will always execute the finally block and finally block you can commit.
86
00:05:45,450 --> 00:05:47,220
Set register its processing.
87
00:05:48,860 --> 00:05:52,910
Dough falls, OK, guys, and that's basically it.
88
00:05:53,180 --> 00:05:55,520
Now we would like to get this data to our page.
89
00:05:55,550 --> 00:05:59,300
OK, so we need to compete at properties in our page and we would like to get his data and display them
90
00:05:59,300 --> 00:06:00,800
so you will see that something is happening.
91
00:06:01,400 --> 00:06:01,940
Let's do it.
92
00:06:03,570 --> 00:06:05,160
Let's go to our pages that are.
93
00:06:07,060 --> 00:06:13,210
OK, and look at how this computer properties above the metal, my photos out here computed it would
94
00:06:13,210 --> 00:06:14,620
like to get here, Arora.
95
00:06:16,570 --> 00:06:22,960
And its processing is processing, you need to wait on air date has already returned.
96
00:06:23,130 --> 00:06:29,260
These we are accessing store, we are accessing state on the store, they are accessing user module.
97
00:06:29,470 --> 00:06:31,270
We are accessing all the user module.
98
00:06:31,270 --> 00:06:31,540
What?
99
00:06:32,700 --> 00:06:34,680
They are testing register and are.
100
00:06:35,900 --> 00:06:39,230
So used to be accessing the register and to air.
101
00:06:40,780 --> 00:06:46,570
The same thing here, Star State user register and here is processing.
102
00:06:48,380 --> 00:06:51,260
We will simplify there, that's a very long expression, as you can see.
103
00:06:51,440 --> 00:06:53,420
OK, so let's save it, guys.
104
00:06:53,440 --> 00:06:58,460
Let's see a template and simply display this data somewhere.
105
00:06:58,790 --> 00:07:00,090
Let's say.
106
00:07:00,290 --> 00:07:04,640
And this here as you have a paragraph.
107
00:07:05,810 --> 00:07:10,870
OK should be formatted correctly from either lowly sparking up here, and let's right here.
108
00:07:11,750 --> 00:07:14,180
Error call on, so this will be for error here.
109
00:07:14,510 --> 00:07:22,370
The curly brackets will display error here and here will be processing like this and the brackets and
110
00:07:22,370 --> 00:07:23,390
is processing.
111
00:07:24,170 --> 00:07:26,060
So you'll see some data on the screen.
112
00:07:27,880 --> 00:07:30,760
OK, let's save it back to browser refresh.
113
00:07:31,890 --> 00:07:35,940
And you can see her error is empty, you don't have any error and processing is false.
114
00:07:36,330 --> 00:07:37,280
S., A. L. Click here.
115
00:07:37,320 --> 00:07:39,630
Sign up processing will be true.
116
00:07:40,390 --> 00:07:40,800
Could see.
117
00:07:41,840 --> 00:07:43,130
Sign up protesting is true.
118
00:07:45,460 --> 00:07:49,840
And then it's false when it's done, but we don't see error, that's actually wrong.
119
00:07:50,990 --> 00:07:56,590
But by the NRA, I have a double triple R here in the Iraqi war, it's my mistake here.
120
00:07:56,600 --> 00:07:57,780
I have a triple R.
121
00:07:57,780 --> 00:07:58,990
I should be does error.
122
00:07:59,540 --> 00:08:00,710
OK, let me verify why.
123
00:08:01,010 --> 00:08:02,180
Yeah, here is everything correct?
124
00:08:04,040 --> 00:08:04,610
OK.
125
00:08:04,760 --> 00:08:05,620
It doesn't misspelt.
126
00:08:06,240 --> 00:08:12,800
OK, refresh, and you'll see error zero processing false suspicions, I look like sign up processing
127
00:08:12,810 --> 00:08:17,270
will be true, then when it's finished will be false and then we'll display error because I'm not providing
128
00:08:17,270 --> 00:08:20,370
any data to sign up processing through.
129
00:08:20,390 --> 00:08:21,440
And now we have an error.
130
00:08:21,920 --> 00:08:22,340
Perfect.
131
00:08:23,460 --> 00:08:27,000
Whenever provide, here are some Kodak Theatre able to sign up.
132
00:08:28,470 --> 00:08:30,820
Ed Miller is a pilot and the processing.
133
00:08:30,840 --> 00:08:32,430
And we are getting better immediately.
134
00:08:33,270 --> 00:08:39,670
But I will say up, be that some use that are, let's say, Test one at Gmail dot com that your password
135
00:08:39,690 --> 00:08:44,950
test test, I will sign up processing true and the false and the error.
136
00:08:44,970 --> 00:08:47,670
So we have successfully successfully registered.
137
00:08:49,500 --> 00:08:52,160
OK, guys, so that's going to be it from this functionality.
138
00:08:53,040 --> 00:08:57,390
You can go to the next lecture if you want to understand it, but if it's still something something
139
00:08:57,390 --> 00:09:00,090
else to clear up, please stay here and I will provide you additional explanation.
140
00:09:02,170 --> 00:09:03,700
So go step by step.
141
00:09:03,850 --> 00:09:09,520
So we are dispatching just right, so there are pitching this election to get the greatest data here.
142
00:09:09,550 --> 00:09:13,230
So first thing what we are doing, we are committing here mutations.
143
00:09:14,020 --> 00:09:16,600
So they are saying he had said that instead of processing is true.
144
00:09:17,260 --> 00:09:18,700
And so that is their error is empty.
145
00:09:18,700 --> 00:09:22,220
Strings of this bill are coming into the state, right?
146
00:09:22,240 --> 00:09:22,900
Pretty clear.
147
00:09:23,500 --> 00:09:28,780
This means when Bill coming to the state, the truth here will be is processing will be true, an empty
148
00:09:28,780 --> 00:09:30,010
string theory said here.
149
00:09:31,530 --> 00:09:31,920
OK.
150
00:09:33,090 --> 00:09:33,510
Then.
151
00:09:35,350 --> 00:09:37,250
OK, then after.
152
00:09:38,340 --> 00:09:40,170
Will execute this function.
153
00:09:42,070 --> 00:09:43,960
But the function will be successfully executed.
154
00:09:45,060 --> 00:09:49,180
They'll simply to jump into the final in the end, and it'll set here, protesting is false soil study
155
00:09:49,180 --> 00:09:49,280
here.
156
00:09:49,290 --> 00:09:50,100
Protesting is false.
157
00:09:50,460 --> 00:09:52,550
This means they're just there has been done.
158
00:09:52,560 --> 00:09:53,260
There are no errors.
159
00:09:53,260 --> 00:09:59,820
So these men who had been successful in occasional executed days but will jump into the cage, look
160
00:09:59,880 --> 00:10:00,240
here.
161
00:10:01,180 --> 00:10:04,780
So there was an hour get the error message and it was said to the register.
162
00:10:04,800 --> 00:10:10,140
So here in the edit, we'll have a message we will propagate towards their page to the consulate property
163
00:10:10,140 --> 00:10:11,490
because the state is linked here.
164
00:10:12,400 --> 00:10:13,800
OK, so we'll get also add here.
165
00:10:15,230 --> 00:10:19,790
OK, and in the final block, which will be executed after the catch because they finally block is always
166
00:10:19,790 --> 00:10:21,020
execute, it doesn't matter.
167
00:10:21,110 --> 00:10:24,040
The try is successful or we will get the error to finally execute.
168
00:10:24,080 --> 00:10:29,510
We all set here so that it starts processing is false because we are down rapidly to propagate this
169
00:10:29,510 --> 00:10:30,360
value any longer.
170
00:10:30,380 --> 00:10:31,610
We can sell it back to the false.
171
00:10:33,790 --> 00:10:36,430
So in a case, because previously error, as you can see here.
172
00:10:37,370 --> 00:10:41,450
We'll be keeping error state, as you thought you saw it when I was submitting the forms to have your
173
00:10:41,450 --> 00:10:41,810
error.
174
00:10:42,950 --> 00:10:46,310
So that's what I hear when I will register again.
175
00:10:46,620 --> 00:10:50,150
Oh, let's say I will correct my data and I will click register again.
176
00:10:50,480 --> 00:10:56,030
I would like to clean up the errors if I had them before, because in this case, maybe my register
177
00:10:56,030 --> 00:10:58,610
will be successful and I don't want to display any error.
178
00:10:58,620 --> 00:11:00,920
So that's why I'm cleaning them up beforehand.
179
00:11:02,210 --> 00:11:06,500
And of course, I'm starting processing through again so I can display some load their icon or I can
180
00:11:06,500 --> 00:11:08,060
disable buttons and so on.
181
00:11:09,670 --> 00:11:14,970
So, guys, that's how it works and the questions today, you can ask what I think is working now,
182
00:11:14,970 --> 00:11:16,780
well, let's continue in the next lecture.
183
00:11:16,850 --> 00:11:17,260
Cheers.
17099
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.