title: How to listen to events with a Listener that has an injected service in Nestjs?
body: <p>I have a listener which listens to events but I also want that listener to call on other services to do stuff as part of the event. ie create a db notification, send an sms etc.</p>
  <p>When I create a constructor to inject the dependant Service the Listener stops picking up the events and when I remove the constructor with  the Service, it starts working again.</p>
  <p>How do I need to structure this for the listener to be able to call other services such as NotificationsService in example below?</p>
  <p>client-updated.listener.ts</p>
  <pre><code>    @Injectable()
      export class ClientUpdatedListener {
  
      constructor(
          @Inject(NotificationsService) private notificationService) {
      }
  
      private readonly logger = new Logger(ClientUpdatedListener.name);
  
      @OnEvent(eventType.CLIENT_UPDATED)
      handleClientUpdatedEvent(event: ClientUpdatedEvent) {
          this.logger.log('Processing event: ' + eventType.CLIENT_UPDATED );
          console.log(event);
  
         this.notificationService.emailClient(event.id);
      }
  </code></pre>
  <p>The Notifications Service.
  It's a shell at the moment but I expect to perform logic and possibly db calls from within it.</p>
  <pre><code>@Injectable()
  export class NotificationsService {
  
      constructor(
          @Inject(TENANT_CONNECTION) private tenantDb,
      ) {}
      
      emailClient(id: string) {
          console.log(id);
      } 
  }
  </code></pre>
  <p>The calling service code</p>
  <pre><code>    const clientUpdatedEvent = new ClientUpdatedEvent();
      clientUpdatedEvent.id = id;
      this.eventEmitter.emit(eventType.CLIENT_UPDATED, clientUpdatedEvent);
  </code></pre>