on( eventName, callback, context )

argumenttypeoptionaldefaultdescription
eventNameStringfalse-The name of the event to describe to
callbackFunctionfalse-The function that should be invoked when the event occurs
contextObjecttrue-The value of the this pointer in the callback function

Subscribe to an event

emit( eventName, arg1, arg2, ...argN )

argumenttypeoptionaldefaultdescription
eventNameStringfalse-The name of the event to emit

Notify listeners of an event and pass arguments along

unbind( eventName, callback, context )

argumenttypeoptionaldefaultdescription
eventNameStringfalse-The name of the event to unsubscribe from
callbackFunctiontrue-The function that should be invoked when the event occurs
contextObjecttrue-The value of the this pointer in the callback function

Unsubscribes either all listeners if just an eventName is provided, just a specific callback if invoked with eventName and callback or just a specific callback with a specific context if invoked with all three arguments.

Comments and Questions

comments powered by Disqus