The application programming model of IoT.js is based on event-driven programming. Thus many objects in IoT.js emit events. events.EventEmitter plays a role as base class for such objects.
User application would not directly create an instance of EventEmitter since EventEmitter is an abstract trait which defines its behavior and grants to sub-classes.
event: Stringlistener: Function([args..])- Returns emitter
Adds listener to the end of list of event listeners for event.
event: String- Returns
Boolean
Invokes each of listener with supplied arguments.
Returns true if there were listeners, false otherwise.
event: Stringlistener: Function([args..])- Returns emitter
Adds listener for one time listener for event.
The listener will be invoked at the next event and removed.
event: Stringlistener: Function([args..])- Returns emitter
Removes listener from the list of event listeners.
If you add the same listener multiple times, this removes only one instance of them.
event: String- Returns emitter
Removes all listeners.
If event was specified, it only removes listeners for that event.