Optional
subscriber: null | EventSubscriptionVendorAdds a listener to be invoked when events of the specified type are emitted. An optional calling context may be provided. The data arguments emitted will be passed to the listener function.
Name of the event to listen to
Function to invoke when the specified event is emitted
Rest
...args: any[]Optional
context: anyOptional context object to use when invoking the listener
Emits an event of the given type with the given data. All handlers of that particular type will be notified.
Name of the event to emit
Rest
...params: any[]emitter.addListener('someEvent', function(message) {
console.log(message);
});
emitter.emit('someEvent', 'abc'); // logs 'abc'
Optional subscriber instance to use. If omitted, a new subscriber will be created for the emitter.