Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

EventEmitter.removeAllListeners

Wolfy87 edited this page Nov 4, 2011 · 1 revision

About

Removes all listeners for a specified event. If no event type is passed it will remove every listener.

Arguments

EventEmitter.removeAllListeners(type);

  • String type Event type name to remove all listeners from

Returns

Object The current EventEmitter instance to allow chaining

Examples

var ee = new EventEmitter();
// Here we would add some events to foo
ee.removeAllListeners('foo'); // Now all foo events are gone
// Here we would add events for foo, bar, cat and dog
ee.removeAllListeners(); // Now every listener is gone, as if ee has been reset