EventsHandler
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
EventsHandler(…
events):DualClassDecorator
Defined in: packages/cqrs/src/decorators.ts:77
Registers a class as a handler of one or more event classes; the class implements
IEventHandler.
Parameters
Section titled “Parameters”events
Section titled “events”…AnyClass[]
Returns
Section titled “Returns”Throws
Section titled “Throws”TypeError when no event class is given, or one is not a class.
Example
Section titled “Example”@EventsHandler(UserCreatedEvent, UserInvitedEvent)class SendWelcomeEmail implements IEventHandler<UserCreatedEvent | UserInvitedEvent> { async handle(event: UserCreatedEvent | UserInvitedEvent) {}}