Today we’re going to learn about EventEmitter
Events (Core module of node js)
First we need to require the events
Now we can do something for clicking any element.
This event
module will help us to use click and different events. We can now create custom events also!
For using the custom event first we'll const myEmitter = new events()
and get new events on myEmitter -
Second step is making a new custom event which is called customEvent
in this occasion
Then finally we need make this event happens using myEmitter.emit
Final Result
So do you understand a bit of EventEmitter right now ?
You can see the graphical version here
Originally it published on nerdjfpbblog. You can connect with me in twitter or linkedin !
You can read the old posts from here --
Top comments (0)