emit() method from fcf.EventEmitter class
Package: fcf-framework-core
File: fcf-framework-core:fcf.js
Available from version: 2.0.2
Raising an event on an object
Arguments
- The name of the event to be called
- Data passed to event handlers as the first argument
Result
- Deferred action object of event processing completion
Example: Function application
class Test extends fcf.EventEmitter {
};
let testObject = new Test();
testObject .on ("call", (a_event)=>{
console.log(a_event)
});
testObject .emit ("call", {info: "value"});
Output:
{ info: 'value' }