on( eventName, callback, context )
argument | type | optional | default | description |
---|---|---|---|---|
eventName | String | false | - | The name of the event to describe to |
callback | Function | false | - | The function that should be invoked when the event occurs |
context | Object | true | - | The value of the this pointer in the callback function |
Subscribe to an event
emit( eventName, arg1, arg2, ...argN )
argument | type | optional | default | description |
---|---|---|---|---|
eventName | String | false | - | The name of the event to emit |
Notify listeners of an event and pass arguments along
trigger( eventName, arg1, arg2, ...argN )
Alias for emit
unbind( eventName, callback, context )
argument | type | optional | default | description |
---|---|---|---|---|
eventName | String | false | - | The name of the event to unsubscribe from |
callback | Function | true | - | The function that should be invoked when the event occurs |
context | Object | true | - | 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.
off( eventName, callback, context )
Alias for unbind