Creates an instance of EventSource.
The object that will be reported as the source of events fired by this instance.
If null or undefined, the EventSource instance itself will be the source.
Dispatches an event with a given name and payload to all registered listeners. A listener that throws: its error goes to console.error, the next listeners are called, and fire returns normally.
Removes a previously registered event listener.
A base class for objects that can emit and listen to custom events. It provides a typed eventing mechanism, allowing for the registration and removal of listeners, and the firing of events with associated payloads.