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

fcf.EventChannel class

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

The event channel class that implements the communication of different program blocks of the framework. The framework can use multiple event channels, but by default it always uses the main event channel, which is available via the fcf.getEventChannel() function

Methods
on(staring a_eventName, function a_callback)
on(staring a_eventName, object a_options, function a_callback)
- Adding an event handler
once(staring a_eventName, function a_callback)
once(staring a_eventName, object a_options, function a_callback)
- Adds an event handler that will only be called once. After the first call, the added event handler is removed from the processing queue.
onmet(staring a_eventName, function a_callback)
onmet(staring a_eventName, object a_options, function a_callback)
- Adds an event handler that is called only for the first call to the event. If the event has already been called before adding the handler, then the event handler is called with the event data that was passed in the previous call.
detach(function a_callback)
detach(string a_eventName, function a_callback)
- Unbinds a callback from a message channel
fcf.Actions->mixed send(string a_eventName, object a_event)
fcf.Actions->mixed send(string a_eventName, object a_eventOptions, object a_event)
- Performs an event dispatch
integer count(string a_eventName)
- Returns the number of event calls made