Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Controller, Inject } from '@nestjs/common'; |
||
2 | import { EventPattern } from '@nestjs/microservices'; |
||
3 | import { TRANSPORT_EVENT_BUS_PATTERN, TRANSPORT_EVENT_BUS_SERVICE, TransportEvent } from 'nestjs-transport-eventbus'; |
||
4 | import { IEvent, IEventBus } from '@nestjs/cqrs'; |
||
5 | |||
6 | @Controller() |
||
7 | export class AppService { |
||
8 | |||
9 | constructor( |
||
10 | @Inject(TRANSPORT_EVENT_BUS_SERVICE) private readonly eventBus: IEventBus |
||
11 | ){ |
||
12 | |||
13 | } |
||
14 | @EventPattern(TRANSPORT_EVENT_BUS_PATTERN) |
||
15 | accumulate(@TransportEvent() event: IEvent): void { |
||
16 | this.eventBus.publish(event); |
||
17 | } |
||
18 | } |
||
19 |