import { EventsHandler , IEventHandler } from '@nestjs/cqrs' ; import { ItemUpdatedEvent } from '../../impl' ; @ EventsHandler ( ItemUpdatedEvent ) export class ItemUpdatedHandler implements IEventHandler < ItemUpdatedEvent > { handle ( event ) { const { id , name } = event . updateItemDto ; console . log ( `Handled ItemUpdatedEvent with ID: ${ id } and name: ${ name }` ) ; } }