OnEvent
Callable
Parameters
ofType: AbstractConstructable<Event<unknown>>
The type of event being listened to.
Returns (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void
The decorated method.
Parameters
target: any
propertyKey: string
descriptor: PropertyDescriptor
Returns void
An
@OnEventis a method decorator to listen to an event.Octo narrates everything it does as Events. Subscribing is how you add logging, reporting, or notifications without changing the framework. A handler receives every event that is an instance of the given type, so listening to a base class such as TransactionEvent catches all of its subclasses.
Decorators