Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 21 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Inject, Injectable } from '@nestjs/common'; |
||
2 | import { TRANSPORT_EVENT_BUS_SERVICE } from 'nestjs-transport-eventbus'; |
||
3 | import { IEventBus } from '@nestjs/cqrs'; |
||
4 | import { DefaultEvent } from './events/default.event'; |
||
5 | import { RabbitEvent } from './events/rabbit.event'; |
||
6 | |||
7 | @Injectable() |
||
8 | export class AppService { |
||
9 | constructor( |
||
10 | @Inject(TRANSPORT_EVENT_BUS_SERVICE) private readonly eventBus: IEventBus |
||
11 | ){ |
||
12 | |||
13 | } |
||
14 | handleDefaultEvent(): void { |
||
15 | this.eventBus.publish(new DefaultEvent('Pass some param')); |
||
16 | } |
||
17 | rabbitEvent(): void { |
||
18 | this.eventBus.publish(new RabbitEvent('Pass some param')); |
||
19 | } |
||
20 | } |
||
21 |