文档中心
互动直播 (Legacy)
API 参考
EventEmitter | Agora Web SDK API Reference v4.18.1
Methods
getListeners
- getListeners(event: string): Function[]
-
Parameters
Returns Function[]
off
- off(event: string, listener: Function): void
-
Parameters
-
event: string
-
listener: Function
Returns void
on
- on(event: string, listener: Function): void
-
Parameters
-
event: string
-
listener: Function
Returns void
once
- once(event: string, listener: Function): void
-
Parameters
-
event: string
-
listener: Function
Returns void
removeAllListeners
- removeAllListeners(event?: undefined | string): void
-
Parameters
-
Optional event: undefined | string
Returns void
EventEmitter
类提供了定义、触发和处理事件的方式。