Class YAHOO.util.Subscriber
Subscriber
Defined in: event.js.
Constructor Attributes | Constructor Name and Description |
---|---|
YAHOO.util.Subscriber(fn, obj, override)
Stores the subscriber information to be used when the event fires.
|
Field Attributes | Field Name and Description |
---|---|
The callback that will be execute when the event fires
|
|
An optional custom object that will passed to the callback when
the event fires
|
|
The default execution scope for the event listener is defined when the
event is created (usually the object which contains the event).
|
Method Attributes | Method Name and Description |
---|---|
contains(fn, obj)
Returns true if the fn and obj match this objects properties.
|
|
getScope(defaultScope)
Returns the execution scope for this listener.
|
|
toString()
|
Class Detail
YAHOO.util.Subscriber(fn, obj, override)
Stores the subscriber information to be used when the event fires.
- Parameters:
- {Function} fn
- The function to execute
- {Object} obj
- An object to be passed along when the event fires
- {boolean} override
- If true, the obj passed in becomes the execution scope of the listener
Field Detail
{function}
fn
The callback that will be execute when the event fires
{object}
obj
An optional custom object that will passed to the callback when
the event fires
{boolean|object}
override
The default execution scope for the event listener is defined when the
event is created (usually the object which contains the event).
By setting override to true, the execution scope becomes the custom
object passed in by the subscriber. If override is an object, that
object becomes the scope.
Method Detail
{boolean}
contains(fn, obj)
Returns true if the fn and obj match this objects properties.
Used by the unsubscribe method to match the right subscriber.
- Parameters:
- {Function} fn
- the function to execute
- {Object} obj
- an object to be passed along when the event fires
- Returns:
- {boolean} true if the supplied arguments match this subscriber's signature.
getScope(defaultScope)
Returns the execution scope for this listener. If override was set to true
the custom obj will be the scope. If override is an object, that is the
scope, otherwise the default scope will be used.
- Parameters:
- {Object} defaultScope
- the scope to use if this listener does not override it.
toString()