GearsORM. Events.js

Event support for GearsORM

License

MIT-style license.

Summary
Event support for GearsORM
add event support to a class
add a listner on a specific event
remove the listner on a specific event
fires the event
wrap a function with a onBefore and onAfter events

GearsORM. Events

add event support to a class

Constructor

Summary
add a listner on a specific event
remove the listner on a specific event
fires the event
wrap a function with a onBefore and onAfter events

Functions

addListener

addListener:function(name,
fn)

add a listner on a specific event

Parameters

namename of the event
fnfunction to call when the event is fired

removeListener

removeListener:function(name,
fn)

remove the listner on a specific event

Parameters

namename of the event
fnfunction to call when the event is fired

fireEvent

fireEvent:function(name,
args,
bind)

fires the event

Parameters

namename of the event
argsarguments to send to the listeners
binda object to bind listeners to

wrapFunction

GearsORM.Events.wrapFunction=function(fn,
name,
object)

wrap a function with a onBefore and onAfter events

Parameters

fnfunction to wrap
namename of the function to wrap
objectthe object who fire the events
addListener:function(name,
fn)
add a listner on a specific event
removeListener:function(name,
fn)
remove the listner on a specific event
fireEvent:function(name,
args,
bind)
fires the event
GearsORM.Events.wrapFunction=function(fn,
name,
object)
wrap a function with a onBefore and onAfter events