FCF 2.0 development in progress...
> > > > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

emit() method from fcf.EventEmitter class

fcf.Actions emit(string a_name, mixed a_data)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Raising an event on an object


string a_name
- The name of the event to be called

mixed a_data
- Data passed to event handlers as the first argument
- 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"});


{ info: 'value' }