Emmit
It is a small library for the management of events, this is based on the library mitt, but it is built according to a class.
yarn add -D emmit
npm install -D emmit
Instance
Emmitt operates like any event manager
; let events = ; let jumpUnsubscribe = events let anyUnsubscribe = events events;
as you will notice every time you store an event emmit returns an unsubscribe for the stored event.
Subscribers in the instance
You can define an object that already stores events from the instance of emmit
let events = jump : { // listener event jump }