How to use the @nestjs/cqrs/dist/decorators/events-handler.decorator.EventsHandler function in @nestjs/cqrs

To help you get started, we’ve selected a few @nestjs/cqrs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kamilmysliwiec / nest-cqrs-example / src / heroes / events / handlers / hero-killed-dragon.handler.ts View on Github external
import { IEventHandler } from '@nestjs/cqrs';
import { EventsHandler } from '@nestjs/cqrs/dist/decorators/events-handler.decorator';
import * as clc from 'cli-color';
import { HeroKilledDragonEvent } from '../impl/hero-killed-dragon.event';

@EventsHandler(HeroKilledDragonEvent)
export class HeroKilledDragonHandler
  implements IEventHandler {
  handle(event: HeroKilledDragonEvent) {
    console.log(clc.greenBright('HeroKilledDragonEvent...'));
  }
}

@nestjs/cqrs

A lightweight CQRS module for Nest framework (node.js)

MIT
Latest version published 2 months ago

Package Health Score

86 / 100
Full package analysis

Similar packages