Interface zebkit.EventProducer | <zebkit> |
Event producer interface. This interface provides number of methods to register, un-register, fire events. It follows on/off notion like JQuery does it. It is expected an event producer class implementation has a special field "_" that keeps listeners.
var MyClass = zebkit.Class(zebkit.EventProducer, [
function() {
// "fired" events listeners container
this._ = new zebkit.Listeners();
}
]);
var a = new MyClass();
a.on("fired", function(arg) {
// handle "fired" events
});
a.fire(10);
public
void
fire (name, [path], [params] )
Fire event with the given parameters. Parameters: |
public
void
off ([eventName], [path], [cb] )
Stop listening the given event type. Parameters:
|
public
void
on ([eventName], [path], cb )
Register listener for the given events types or/and the given nodes in tree-like structure or listen all events types. Parameters:
Example:
|