Skip to content

Latest commit

 

History

History

exercise_3.3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Node.js Design Patterns Third Edition Exercise Solutions


Exercise 3.3 - A simple modification


Explanation

The key thing here is the process.nextTick() method, as explained in the book.

You can not call the on method from a function that returns an event emitter stright away, unless a setInterval or setTimeout it's used, basically relying on the next round of the event loop, so process.nextTick() is quite usefull here.

Using npm

$ npm start_3_3

Using yarn:

$ yarn start_3_3