1. eve()
  2. eve.listeners()
  3. eve.nt()
  4. eve.on()
  5. eve.unbind()
  6. eve.version

Eve Reference

eve

Fires event with given name, given scope and other parameters.

Arguments
name
string
name of the event, dot (.) or slash (/) separated
scope
object
context for the event handlers
varargs
...
the rest of arguments will be sent to event handlers

Returns: array array of errors, if any. Each element of the array is in format:

{
    error: // error message,
    func: // handler that caused error
}

eve.listeners

Internal method which gives you array of all event handlers that will be triggered by the given name.

Arguments
name
string
name of the event, dot (.) or slash (/) separated

Returns: array array of event handlers

eve.nt

Could be used inside event handler to figure out actual name of the event.

Arguments
subname
optional
string
subname of the event

Returns: string name of the event, if subname is not specified

or

Returns: boolean true, if current event’s name contains subname

eve.on

Binds given event handler with a given name. You can use wildcards “*” for the names:

eve.on("*.under.*", f);
eve("mouse.under.floor"); // triggers f

Use eve to trigger the listener.

Arguments
name
string
name of the event, dot (.) or slash (/) separated, with optional wildcards
f
function
event handler function

Returns: boolean false if given function already assigned as event handler to given name, true otherwise

eve.unbind

Removes given function from the list of event listeners assigned to given name.

Arguments
name
string
name of the event, dot (.) or slash (/) separated, with optional wildcards
f
function
event handler function

eve.version

string

Current version of the library.