Skip to content

Home > @esengine/ecs-framework-monorepo > EventHandler

EventHandler() function

事件装饰器工厂 用于自动注册事件监听器

Signature:

typescript
export declare function EventHandler(eventType: string, config?: IEventListenerConfig): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;

Parameters

Parameter

Type

Description

eventType

string

config

IEventListenerConfig

(Optional)

Returns:

(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

基于 MIT 许可证发布