Blame | Last modification | View Log | RSS feed
# IntroductionÉvénement is is French and means "event". The événement library aims toprovide a simple way of subscribing to events and notifying those subscriberswhenever an event occurs.The API that it exposes is almost a direct port of the EventEmitter API foundin node.js. It also includes an "EventEmitter". There are some minordifferences however.The EventEmitter is an implementation of the publish-subscribe pattern, whichis a generalized version of the observer pattern. The observer patternspecifies an observable subject, which observers can register themselves to.Once something interesting happens, the subject notifies its observers.Pub/sub takes the same idea but encapsulates the observation logic inside aseparate object which manages all of its subscribers or listeners. Subscribersare bound to an event name, and will only receive notifications of the eventsthey subscribed to.**TLDR: What does evenement do, in short? It provides a mapping from eventnames to a list of listener functions and triggers each listener for a givenevent when it is emitted.**Why do we do this, you ask? To achieve decoupling.It allows you to design a system where the core will emit events, and modulesare able to subscribe to these events. And respond to them.