test/int/transport-eventbus/handlers/try.saga.handler.ts   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 20
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 15
dl 0
loc 20
rs 10
c 0
b 0
f 0
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A TrySagaHandler.dragonKilled 0 5 1
1
import { Injectable } from '@nestjs/common';
2
import { Observable } from 'rxjs';
3
import { ICommand, ofType, Saga } from '@nestjs/cqrs';
4
import { map } from 'rxjs/operators';
5
import { SagaEvent } from '../events/test.events';
6
import { TrySagaCommand } from '../commands/try.saga.command';
7
8
@Injectable()
9
export class TrySagaHandler {
10
    @Saga()
11
    dragonKilled = (events$: Observable<any>): Observable<ICommand> => {
12
        return events$.pipe(
13
            ofType(SagaEvent),
14
            map((event: SagaEvent) => {
15
                return new TrySagaCommand(event.message);
16
            }),
17
        );
18
    }
19
}
20