1
00:00:00,330 --> 00:00:00,870
Excellent.

2
00:00:00,900 --> 00:00:04,560
Once we have covered async patterns, we're going to use throughout the course.

3
00:00:04,920 --> 00:00:13,290
Now let's talk about events in Algiers when working on browser JavaScript apps, a big part of our work

4
00:00:13,680 --> 00:00:15,390
is to handle events.

5
00:00:15,780 --> 00:00:18,690
For example, user clicks a button.

6
00:00:19,170 --> 00:00:22,020
And of course, in our program, we handle that.

7
00:00:22,380 --> 00:00:24,170
User hovers over the link.

8
00:00:24,630 --> 00:00:27,210
And again, same deal in our program.

9
00:00:27,390 --> 00:00:28,500
We are handling that.

10
00:00:28,680 --> 00:00:36,330
And hopefully you get the gist essentially as our program executes, at least in part, it is controlled

11
00:00:36,330 --> 00:00:39,150
by events, of course, depending on the program.

12
00:00:39,150 --> 00:00:45,030
But it's safe to say that in browser app those events are mostly external.

13
00:00:45,630 --> 00:00:49,650
Now that style of programming is actually called event driven programming.

14
00:00:50,100 --> 00:00:57,030
And effectively, it's just that a style in which the flow of the program is at least in part, determined

15
00:00:57,270 --> 00:01:01,800
by the events that occur as the program executes.

16
00:01:02,280 --> 00:01:08,550
Now, it's easier to imagine that, of course, when you have a GUI, right, the graphical interface,

17
00:01:09,000 --> 00:01:12,680
just like the button and Linc's example I just mentioned.

18
00:01:13,230 --> 00:01:14,730
But what about server side?

19
00:01:15,360 --> 00:01:16,350
Is it also possible?

20
00:01:16,740 --> 00:01:18,420
And of course, the answer is yes.

21
00:01:18,430 --> 00:01:24,660
In fact, event driven programming is used heavily in jazz, and in the following videos you'll see

22
00:01:24,660 --> 00:01:26,340
some of the examples of it.

23
00:01:26,850 --> 00:01:28,800
And basically the idea is following.

24
00:01:28,800 --> 00:01:35,610
We listen for specific events and register functions that will execute in response to those events.

25
00:01:36,180 --> 00:01:43,160
So once our event takes place, hombach function fires just like in our imaginary button example.

26
00:01:43,680 --> 00:01:45,750
Now, before we continue, let me stress something.

27
00:01:45,900 --> 00:01:50,130
Our first examples are going to be basic and even somewhat silly.

28
00:01:50,580 --> 00:01:51,960
But don't let that fool you.

29
00:01:52,560 --> 00:01:59,850
Many built in modules and Norges do use events under the hood and therefore making events an event driven

30
00:01:59,850 --> 00:02:03,380
programming a big part of no jayesh.

