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

EventEmitter.emit

Wolfy87 edited this page Nov 5, 2011 · 1 revision

About

Emits an event executing all appropriate listeners. All values passed after the type will be passed as arguments to the listeners.

Arguments

EventEmitter.emit(type);

  • String type Event type name to run all listeners from

Returns

Object The current EventEmitter instance to allow chaining

Examples

var ee = new EventEmitter();
ee.on('speak', function(message) {
    alert(message);
});

ee.emit('speak', 'Hello, World!'); // Will alert "Hello, World!"