UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

21 lines (13 loc) 330 B
# EventEmitter Abstract class for event listeners and triggers. Allow for all components to listen and fire events. ## Examples ```js const eventName = "eventName"; component.on(eventName, (event) => { console.log("Event fired"); }); // ... const event = new BaseEvent(eventName, component); component.fire(event); ```