Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,390 --> 00:00:06,000
Hi there, welcome back here in the last lecture, we have created new state in our user module.
2
00:00:06,630 --> 00:00:09,780
In this lecture, we'll continue with the further improvements.
3
00:00:09,780 --> 00:00:11,910
I would like to show you a new concept.
4
00:00:13,140 --> 00:00:13,650
Oh, right.
5
00:00:13,680 --> 00:00:16,650
Let's begin in our register page.
6
00:00:17,130 --> 00:00:23,280
Let's register this view and the new concept I would like to show you is called watchers.
7
00:00:24,330 --> 00:00:30,410
OK, so similar as is with the consulate properties, you can have the vouchers and you can watch for
8
00:00:30,510 --> 00:00:35,700
changes of your data or you can watch for changes of the computer properties itself.
9
00:00:37,290 --> 00:00:42,540
What I mean by that is let's create here some board chair under the computer that you can simply create
10
00:00:42,540 --> 00:00:44,310
here in your property called the watch.
11
00:00:44,880 --> 00:00:45,340
OK.
12
00:00:45,420 --> 00:00:48,330
It'll be the object so that your column curly brackets.
13
00:00:48,330 --> 00:00:49,800
Don't forget a comma after that.
14
00:00:51,560 --> 00:00:55,300
And let's say I would like to watch the changes of my error.
15
00:00:56,410 --> 00:01:04,150
What they need to do, I need to call my watcher exactly as I am calling my computer properly, so I
16
00:01:04,150 --> 00:01:06,070
will carry a voucher for error.
17
00:01:08,060 --> 00:01:14,240
OK, and I'll have a complete properly reacting to the state changes in our user module.
18
00:01:14,930 --> 00:01:17,660
And I have a watch that's reacting to the computer properly.
19
00:01:18,500 --> 00:01:22,760
So whenever the computer property changes, also, the voucher will be executed.
20
00:01:24,320 --> 00:01:28,320
And in the virtual, we can get the value OK.
21
00:01:28,370 --> 00:01:29,350
And I will.
22
00:01:29,450 --> 00:01:34,100
In this case, I will just already doubts over the alert I'll value.
23
00:01:37,410 --> 00:01:42,390
OK, so whenever I look at the error here, then we'll alert the value, that's how Voltabox, they're
24
00:01:42,660 --> 00:01:45,570
reacting to the changes of the status of an able sign up in an empty forum.
25
00:01:45,990 --> 00:01:48,630
You will see I will alert this error message.
26
00:01:49,080 --> 00:01:51,540
So this is coming from now from the baucher.
27
00:01:53,750 --> 00:01:53,990
All right.
28
00:01:54,020 --> 00:01:59,510
Maybe you're asking why I will donate her need, whatever I have here copies properly and I can do the
29
00:01:59,510 --> 00:02:00,230
same thing here.
30
00:02:00,260 --> 00:02:03,170
I can just simply get alert and I can get it here.
31
00:02:04,210 --> 00:02:07,120
But I need to get it like these, the right, sorry to hear.
32
00:02:08,020 --> 00:02:12,400
Yeah, of course, you can do it this way, but there is a difference between the compute properties
33
00:02:12,400 --> 00:02:13,210
and the watchers.
34
00:02:14,140 --> 00:02:17,200
Compute properties are so-called a lazy.
35
00:02:17,770 --> 00:02:21,280
What does it mean is that they are reacting only when the data changes?
36
00:02:22,560 --> 00:02:29,670
So, for example, if I have an error, some error message that I will get the same error message that
37
00:02:29,670 --> 00:02:32,580
copied properly will be not re executed.
38
00:02:33,060 --> 00:02:38,970
OK, so if the data changes are the same, so I'm going from the same state to the same state that copy
39
00:02:39,360 --> 00:02:43,050
properly will be not executed by the Watcher will be all the time we execute.
40
00:02:43,050 --> 00:02:45,810
It doesn't matter if they're valuable changes or not.
41
00:02:46,050 --> 00:02:47,820
Diversity, I will always react.
42
00:02:48,360 --> 00:02:48,690
OK.
43
00:02:48,930 --> 00:02:54,810
So for example, I will show that if I have an error of error message, let's say exactly like this.
44
00:02:54,810 --> 00:02:58,170
I have error messages like these Firebase error.
45
00:02:58,200 --> 00:02:59,160
That's my error message.
46
00:03:00,630 --> 00:03:08,490
OK, if I will then blaze the registration again for, let's say, and the error will become again.
47
00:03:08,490 --> 00:03:09,570
Firebase error.
48
00:03:10,320 --> 00:03:11,820
OK, so the same error message.
49
00:03:13,160 --> 00:03:18,530
Then the consulate properly wouldn't be called because I am going from the same state to the same state
50
00:03:18,830 --> 00:03:22,400
database error, the Watcher will be not reacting to this change.
51
00:03:23,210 --> 00:03:28,790
Actually, the consulate properly wouldn't be reacting to this change, OK, because copy that copy
52
00:03:28,850 --> 00:03:29,930
properly are lazy.
53
00:03:30,500 --> 00:03:35,840
So if the error is the same or the data are the same, then the copied properly will not react.
54
00:03:36,290 --> 00:03:37,910
But the watcher would react.
55
00:03:38,540 --> 00:03:43,670
So in the case you want to display some, let's say some pop up here, they will display the error message,
56
00:03:43,670 --> 00:03:46,400
even though it's same as the watcher.
57
00:03:47,440 --> 00:03:49,690
OK, because computers probably wouldn't be reacting again.
58
00:03:51,070 --> 00:03:52,120
So that's the main difference.
59
00:03:53,110 --> 00:03:57,910
And that's how you can react to the changes of your data and also to the computer.
60
00:03:57,910 --> 00:03:58,960
That's properties.
61
00:03:59,830 --> 00:04:02,620
I didn't show you how you can react to the changes of the data.
62
00:04:05,130 --> 00:04:09,660
OK, so as a simple about how to create or react to the changes of the data should be, of course,
63
00:04:09,670 --> 00:04:14,160
just create a composite property, let's say, um, let's say we'll be reacting to the changes of the
64
00:04:14,160 --> 00:04:14,850
passport.
65
00:04:15,150 --> 00:04:20,670
OK, so about your passport compares property passports, compared property?
66
00:04:20,670 --> 00:04:22,190
We'll just simply return here.
67
00:04:22,320 --> 00:04:26,280
These form dot dot passport.
68
00:04:27,520 --> 00:04:33,950
OK, you like it properly, and I can react to this so-called your password, and I can in this case,
69
00:04:33,950 --> 00:04:38,950
they just do not get bother with the alerts, just like your console.log and I get to hold its value
70
00:04:38,950 --> 00:04:40,090
from the password to watch.
71
00:04:40,360 --> 00:04:41,650
So we are watching here for this.
72
00:04:41,860 --> 00:04:42,610
Copy that here.
73
00:04:43,650 --> 00:04:45,630
But three right there, and they got a state for password.
74
00:04:47,010 --> 00:04:51,600
So let's save it and go back to browser and you will see whenever I will be typing here.
75
00:04:53,210 --> 00:04:53,900
I'll be watching.
76
00:04:53,960 --> 00:04:56,480
I will be watching for this and I am displaying these and I console.
77
00:04:58,010 --> 00:05:00,980
What's interesting also on board is that you can get also all to value.
78
00:05:00,980 --> 00:05:07,370
Your previous value had been stored there, so I can ride here old value or previous value, and I can
79
00:05:07,370 --> 00:05:09,170
get this old value.
80
00:05:09,690 --> 00:05:17,840
OK, so going to get here, I'll let you see for the current and our will here, all of all four old.
81
00:05:19,790 --> 00:05:25,520
And he actually called them like this and the coma and the coma, he was right there, some space between
82
00:05:25,520 --> 00:05:27,530
the sea and the Oh, like this?
83
00:05:28,960 --> 00:05:31,480
OK, so we'll see the old value now, but they will refresh.
84
00:05:32,560 --> 00:05:38,020
I'll type in the password one, you can see current values, one old one is nothing because we didn't
85
00:05:38,020 --> 00:05:39,830
have any old values that are of value.
86
00:05:40,140 --> 00:05:43,210
But up here to the current value is one two.
87
00:05:43,420 --> 00:05:48,130
But old value is one one two three one two three one two and so on.
88
00:05:48,250 --> 00:05:49,090
So you've got a point.
89
00:05:49,690 --> 00:05:51,430
That's also what you can do with what you're.
90
00:05:53,800 --> 00:05:59,950
Maybe you are now wondering why I have to create our consulate property rights property for the password
91
00:05:59,950 --> 00:06:01,330
and then watch for a password.
92
00:06:02,950 --> 00:06:07,930
Can I watch for a nest of properties such as forum so formed with the password without creating any
93
00:06:07,930 --> 00:06:08,950
computers proper?
94
00:06:09,400 --> 00:06:10,220
Yeah, you can do it.
95
00:06:10,240 --> 00:06:12,640
You can just enable this password.
96
00:06:13,120 --> 00:06:16,950
And if anybody like to access this, you need to be very bright, the watcher.
97
00:06:17,680 --> 00:06:25,000
You need to value like these need to provide a hierarchy of your nested property and here column and
98
00:06:25,000 --> 00:06:25,710
the function.
99
00:06:28,540 --> 00:06:29,530
Function like this.
100
00:06:30,400 --> 00:06:36,460
OK, and you are watching know what NASA's property of Forum Dot password will just stuck at here.
101
00:06:37,620 --> 00:06:40,650
You're watching for the forum dot password like this.
102
00:06:41,430 --> 00:06:44,040
And it will work exactly the same, so you can save it.
103
00:06:45,700 --> 00:06:47,970
Refresh open here.
104
00:06:50,560 --> 00:06:52,750
OK, so that's working the same.
105
00:06:54,460 --> 00:06:54,910
All right, guys.
106
00:06:54,970 --> 00:06:59,050
That's the watchers just to recapitulate to know that the basic difference comparable properties are
107
00:06:59,050 --> 00:07:03,160
lazy day who will be executed only if that data will change.
108
00:07:03,530 --> 00:07:08,440
OK, but the data will change in this matter that the data will be different as the previous data,
109
00:07:08,440 --> 00:07:11,380
as the new value will be, the different as the old value.
110
00:07:11,900 --> 00:07:14,380
OK, the watchers are more reactive.
111
00:07:14,410 --> 00:07:19,900
The watchers will be reacting always, even though the data that has changes are the same as the previous
112
00:07:19,900 --> 00:07:20,290
data.
113
00:07:21,070 --> 00:07:24,670
So the difference will be not using that heavily, the watchers.
114
00:07:24,670 --> 00:07:27,100
But it's good to know that you have also this option.
115
00:07:27,460 --> 00:07:28,930
And guys, it's going to be it.
116
00:07:29,200 --> 00:07:30,250
See you in the next lecture.
11085
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.