Skip to content

EventEmitter Class Reference

devongovett edited this page Jun 15, 2012 · 2 revisions

The EventEmitter class enables event subscription and emitting for subclasses. The EventEmitter class itself does nothing - you must subclass it or use one of its subclasses found in Aurora.

Methods

Methods

EventEmitter#on(event, fn)

Subscribes the given function to the specified event.

EventEmitter#off(event, fn)

Unsubscribes the given function from the specified event.

EventEmitter#once(event, fn)

Subscribes the given function to the specified event. The function is only invoked the next time the event is fired, after which it is removed.

EventEmitter#emit(event, args...)

Invokes each of the functions subscribed to the specified event, passing the specified arguments.

Clone this wiki locally