module/src/event-emitter.js
/**
     * Dispatch an event of a specified type to all current listeners.
     * @param {Event} event - the event to dispatch
     */
Dispatch an event of a specified type to all current listeners.
@param {Event} event - the event to dispatch
Dispatch an event of a specified type to all current listeners . @param { Event } event - the event to dispatch
dispatchEvent(event) {
        if (event == null) {
            throw new TypeError(`Parameter 'event' must be provided.`);
        }
        if (event.type == null) {
            throw new TypeError(`Parameter 'event' must specify a 'type' property.`);
        }
        event.target = this;
        const listeners = this._getListenersForType(event.type);
        listeners.forEach(listener => listener(event));
    }
dispatchEvent ( event ) { if ( event == null ) { throw new TypeError ( ` ` ) ; } if ( event . type == null ) { throw new TypeError ( ` ` ) ; } event . target = this ; const listeners = this . _getListenersForType ( event . type ) ; listeners . forEach ( listener => listener ( event ) ) ; }
Dispatch an event of a specified type to all current listeners.
Dispatch an event of a specified type to all current listeners .
// ensure we record the sender of the event