I'm trying to understand some snippet of code from one open-source project where I don't understand what means to call EventEmitter.emit
with the asterisk '*'
as an event name.
In some libs (like JQuery), '*'
as an event name means 'all events'.
What does it mean within the context of the EventEmitter?
I tried to find a listener for the '*'
event in this project, but no luck.
class BlaBla extends EventEmitter {
methodCall(event){
this.emit("*", {event}); // <- what does this mean ???
}
}
this.emit("*", {event});
means that Calling the emit() method will execute all the functions that are registered with the on method.