EventEmitter.removeAllListeners() 方法
移除所有监听器。如果提供了事件参数,则只会移除该事件的监听器。
签名
class EventEmitter {
removeAllListeners(type?: keyof EventsWithWildcard<Events>): this;
}
参数
|
参数 |
类型 |
说明 |
|---|---|---|
|
type |
keyof EventsWithWildcard<Events> |
(可选) 要移除监听器的事件。 |
返回值:
this
this 以便链式调用方法。