1
00:00:00,330 --> 00:00:06,570
All right, and once we have covered the basic setup, man, let me show you some things that I would

2
00:00:06,570 --> 00:00:07,570
want you to be aware of.

3
00:00:08,029 --> 00:00:11,980
First, we can have as many methods we would want.

4
00:00:12,270 --> 00:00:15,420
So, for example, we have the same event we have here.

5
00:00:15,540 --> 00:00:16,560
Response, correct.

6
00:00:16,800 --> 00:00:18,300
And we are omitting it.

7
00:00:18,690 --> 00:00:20,640
So nothing stops me here.

8
00:00:20,910 --> 00:00:22,770
Just copy and paste.

9
00:00:23,610 --> 00:00:29,970
And listen, for the same event, which, of course, in our case is this response, and then do some

10
00:00:29,970 --> 00:00:35,900
other logic in my call back again, in my case, it's just going to be simple, different consulates.

11
00:00:35,940 --> 00:00:39,810
So I'm going to say some other logic here.

12
00:00:40,080 --> 00:00:46,050
And I'm not going to copy and paste the same function 20 thousand times just to prove my point.

13
00:00:46,050 --> 00:00:53,970
But hopefully I understand that, yes, we can emet our event and then yes, also we can have as many

14
00:00:54,120 --> 00:00:59,500
functions we would want here that are listening for that event and do some other logic.

15
00:00:59,670 --> 00:01:00,990
So that's point number one.

16
00:01:01,380 --> 00:01:07,250
Point number two that I would like to make is the fact that this order matters.

17
00:01:08,160 --> 00:01:12,390
So we first listen for event and then we.

18
00:01:13,100 --> 00:01:20,820
So for example, if I will place my Emet above the second function or above both of the functions,

19
00:01:21,120 --> 00:01:24,650
which you'll notice, but I have nothing in a console.

20
00:01:25,230 --> 00:01:25,580
Why?

21
00:01:25,770 --> 00:01:30,090
Well, because I first met the event and only then I listened for it.

22
00:01:30,720 --> 00:01:32,430
As you can see, that doesn't make sense.

23
00:01:32,540 --> 00:01:37,870
First we would want to listen for the event and only then we would amend it.

24
00:01:37,890 --> 00:01:40,160
So in this case, notice I don't have this.

25
00:01:40,160 --> 00:01:46,590
Some other logic goes in here because I listened for a response and then I right away and get the response.

26
00:01:46,590 --> 00:01:51,500
And then again, I listened for response, but I already admitted the event correct.

27
00:01:51,930 --> 00:01:56,720
So it doesn't make sense to listen for the event once it has been already committed.

28
00:01:57,120 --> 00:01:58,950
So that's the point number two.

29
00:01:59,370 --> 00:02:06,210
And then thirdly, our I also want to showcase that we can pass the arguments when we're omitting the

30
00:02:06,210 --> 00:02:06,530
event.

31
00:02:06,750 --> 00:02:12,660
So, for example, I go here with my Emet, I pass in the name, which is of course, response, and

32
00:02:12,660 --> 00:02:14,940
then I can pass and more arguments.

33
00:02:15,240 --> 00:02:17,070
For example, here I'll go John.

34
00:02:17,310 --> 00:02:19,710
And then the ID number thirty four.

35
00:02:19,950 --> 00:02:24,060
So string and a number and then in my callback function.

36
00:02:25,050 --> 00:02:29,800
I can access those arguments as performers, just like normal functions.

37
00:02:30,180 --> 00:02:37,980
So in this case, I'll call them name and ID and simply in my control log on say name and the second

38
00:02:37,980 --> 00:02:46,980
one will be with I.D. on line, whatever it is that I do now, I'll add here data received user and

39
00:02:46,980 --> 00:02:47,700
then save it.

40
00:02:48,030 --> 00:02:53,430
And it's no surprise that in a console actually they received user John with ID three four.

41
00:02:53,670 --> 00:02:57,480
Now in the second function, as you can see, I wasn't looking for those arguments.

42
00:02:57,810 --> 00:03:00,990
I just don't have access to the arguments because I don't have the parameters.

43
00:03:01,380 --> 00:03:07,590
But it's not like everything broke just because in the event I passed in the arguments.

