EventMixin


Module hilo/event/EventMixin Requires hilo/core/Class Source EventMixin.js
EventMixin is a mixin on event related functions. Use Class.mix(target, EventMixin) to add event function onto target.

Methods

Method Defined
fire(type:String, detail:Object):Boolean
static Send events.
EventMixin
off(type:String, listener:Function):Object
static Remove one event listener.
EventMixin
on(type:String, listener:Function, once:Boolean):Object
static Add an event listenser.
EventMixin

Method Detail

[Static] fire(type:String, detail:Object):Boolean
Send events. If the first parameter is an Object, take it as an Event Object.
parameters
type:String — Event type to send.
detail:Object — The detail (parameters go with the event) of Event to send.
return
Boolean — Whether Event call successfully.
[Static] off(type:String, listener:Function):Object
Remove one event listener. Remove all event listeners if no parameter provided, and remove all event listeners on one type which is provided as the only parameter.
parameters
type:String — The type of event listener that want to remove.
listener:Function — Event listener callback function to be removed.
return
Object — The Event itself. Functions chain call supported.
[Static] on(type:String, listener:Function, once:Boolean):Object
Add an event listenser.
parameters
type:String — Event type to listen.
listener:Function — Callback function of event listening.
once:Boolean — Listen on event only once and no more response after the first response?
return
Object — The Event itself. Functions chain call supported.