publish( ev ) {
    const event = ev;
    /* Check that an event was provided and that is of the correct type */
    if ( !event || !( event instanceof Event )) {
      throw new EventBusException( 'An event must be supplied' );
    }

    /* Check that the event is a defined event */
    if ( this.events.indexOf( event.getName()) === -1 ) {
      this.logger.warning( `Event with name ${event.getName()} has not be defined, not publishing` );
      return;
    }

    /* Log that the event has been published */
    this.logger.debug( event.getName(), event );

    /* Mark the event as published and publish */
    event.published = true;
    this.ee.emit( event.getName(), event );
  }
/* The publish function publishes the supplied event on the EventBus */
The publish function publishes the supplied event on the EventBus
The publish function publishes the supplied event on the EventBus
publish( ev ) {
    const event = ev;
    if ( !event || !( event instanceof Event )) {
      throw new EventBusException( 'An event must be supplied' );
    }
    if ( this.events.indexOf( event.getName()) === -1 ) {
      this.logger.warning( `Event with name ${event.getName()} has not be defined, not publishing` );
      return;
    }
    this.logger.debug( event.getName(), event );
    event.published = true;
    this.ee.emit( event.getName(), event );
  }
publish ( ev ) { const event = ev ; if ( ! event || ! ( event instanceof Event ) ) { throw new EventBusException ( 'An event must be supplied' ) ; } if ( this . events . indexOf ( event . getName ( ) ) === - 1 ) { this . logger . warning ( ` ${ event . getName ( ) } ` ) ; return ; } this . logger . debug ( event . getName ( ) , event ) ; event . published = true ; this . ee . emit ( event . getName ( ) , event ) ; }
The publish function publishes the supplied event on the EventBus
The publish function publishes the supplied event on the EventBus
/* Check that an event was provided and that is of the correct type */ /* Check that the event is a defined event */ /* Log that the event has been published */ /* Mark the event as published and publish */