import { DomainEvents } from '@server/shared/src/core/domain/events/DomainEvents' ; import { IHandle } from '@server/shared/src/core/domain/events/IHandle' ; import { UserEmailChangedEvent } from '../domain/events/UserEmailChangedEvent' ; export class AfterUserEmailChanged implements IHandle < UserEmailChangedEvent > { constructor ( ) { this . setupSubscriptions ( ) ; } setupSubscriptions ( ) { DomainEvents . register ( this . onUserEmailChangedEvent . bind ( this ) , UserEmailChangedEvent . name ) ; } private async onUserEmailChangedEvent ( event ) { const { user } = event ; console . log ( user ) ; } }