Synthetic Event
This library provides a simplified implementation of the two interfaces Event and EventTarget. The included base classes can be used to create synthetic events and custom event targets in any environment.
If your focus lies on DOM events, please refer to the native CustomEvent class. An alternative way to create custom event targets in a browser environment is to use a DocumentFragment as a dummy target.
Installation
npm install synthetic-event
Usage
Basics
; const eventTarget = ; eventTarget; eventTarget; eventTarget;
Custom Events
; { supertype; thismyData = null; }
Custom EventTargets
; { super; thismyEvent = "tick"; ; }
Contributing
Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.