You know the .on('eventName', function(){...});
pattern that exists within jQuery, socket.io, peerjs and a few other libraries/frameworks for event handling, what is it called?
I'd like to get a better idea of the structure behind the scenes, what it can do, whats really going on etc, but haven't been able to turn up much from Google searches, does the pattern have a name? did someone specific come up with this pattern?
From what I can gather so far it seems to be similar to addEventListener
, are there any specific differences?
EDIT: Just to clear things up a little, I'm looking to implement some type of event handling into one of my Node JS applications and ideally want to be able to trigger events that will be caught like below, and was looking for research into best practice - just couldn't figure out good search terms etc.
var myNewObject = new MyLibrary();
myNewObject.on('event_1', function(param1, param2){
...
});
Thanks!