2022-07-05 13:41:43 +00:00
|
|
|
---
|
|
|
|
sidebar_label: EventEmitter.removeAllListeners
|
|
|
|
---
|
|
|
|
|
|
|
|
# EventEmitter.removeAllListeners() method
|
|
|
|
|
|
|
|
Removes all listeners. If given an event argument, it will remove only listeners for that event.
|
|
|
|
|
|
|
|
**Signature:**
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
class EventEmitter {
|
|
|
|
removeAllListeners(event?: EventType): EventEmitter;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --------- | ------------------------------------- | ---------------------------------------------------- |
|
|
|
|
| event | [EventType](./puppeteer.eventtype.md) | <i>(Optional)</i> the event to remove listeners for. |
|
|
|
|
|
|
|
|
**Returns:**
|
|
|
|
|
|
|
|
[EventEmitter](./puppeteer.eventemitter.md)
|
|
|
|
|
|
|
|
`this` to enable you to chain method calls.
|