File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- // Example: 01 The EventEmitter class is defined and exposed by the events module
1
+ // Example: The EventEmitter class is defined and exposed by the events module
2
2
const EventEmitter = require ( 'events' ) ;
3
3
const util = require ( 'util' ) ;
4
4
@@ -11,7 +11,7 @@ eventObject.on('event', () => {
11
11
eventObject . emit ( 'event' ) ;
12
12
13
13
14
- // Example: 02 Asynchronous vs. Synchronous
14
+ // Example: Asynchronous vs. Synchronous
15
15
const eventObject2 = new Event ( ) ;
16
16
eventObject2 . on ( 'event' , ( ) => {
17
17
setImmediate ( ( ) => { // Used for Asynchronous function call
@@ -21,12 +21,12 @@ eventObject2.on('event', () => {
21
21
eventObject2 . emit ( 'event' ) ;
22
22
23
23
24
- // Example: 03 Error Events
24
+ // Example: Error Events
25
25
//const eventObject3 = new Event();
26
26
//eventObject3.emit('error', new Error('whoops! An error occurred.'));
27
27
28
28
29
- // Example: 04
29
+ // Example: Inherits
30
30
class Person {
31
31
constructor ( name ) {
32
32
this . name = name ;
You can’t perform that action at this time.
0 commit comments