Test.EventTarget Class
yui3/src/test/js/EventTarget.js:2
Simple custom event implementation.
Index
Methods
- attach
- detach
- fire
- subscribe deprecated
- unsubscribe deprecated
Properties
- _handlers static
Methods
attach
-
type
-
listener
Adds a listener for a given event type.
Parameters:
-
type
StringThe type of event to add a listener for.
-
listener
FunctionThe function to call when the event occurs.
detach
-
type
-
listener
Removes a listener for a given event type.
Parameters:
-
type
StringThe type of event to remove a listener from.
-
listener
FunctionThe function to remove from the event.
fire
-
event
Fires an event based on the passed-in object.
Parameters:
-
event
Object | StringAn object with at least a 'type' attribute or a string indicating the event name.
subscribe
-
type
-
listener
Adds a listener for a given event type.
Parameters:
-
type
StringThe type of event to add a listener for.
-
listener
FunctionThe function to call when the event occurs.
unsubscribe
-
type
-
listener
Removes a listener for a given event type.
Parameters:
-
type
StringThe type of event to remove a listener from.
-
listener
FunctionThe function to remove from the event.
Properties
_handlers
Object
private
static
Event handlers for the various events.