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