Home > @esengine/ecs-framework-monorepo > IEventBus > once
IEventBus.once() method
监听事件(一次性)
Signature:
typescript
once<T>(eventType: string, handler: (data: T) => void, config?: IEventListenerConfig): string;
Parameters
Parameter | Type | Description |
---|---|---|
eventType | string | 事件类型 |
handler | (data: T) => void | 事件处理器 |
config | (Optional) 监听器配置 |
Returns:
string
监听器ID