Subscriber Class
yui3/src/event-custom/js/subscriber.js:1
Stores the subscriber information to be used when the event fires.
Constructor
Subscriber
-
fn -
context -
args
Parameters:
-
fnFunctionThe wrapped function to execute.
-
contextObjectThe value of the keyword 'this' in the listener.
-
argsArray multiple0..n additional arguments to supply the listener.
Methods
contains
-
fn -
context
Returns true if the fn and obj match this objects properties. Used by the unsubscribe method to match the right subscriber.
Parameters:
-
fnFunctionthe function to execute.
-
contextObjectoptional 'this' keyword for the listener.
Returns:
true if the supplied arguments match this subscriber's signature.
notify
-
args -
ce
Executes the subscriber.
Parameters:
-
argsArrayArguments array for the subscriber.
-
ceCustomEventThe custom event that sent the notification.
Properties
args
Array
Additional arguments to propagate to the subscriber
context
Object
Optional 'this' keyword for the listener
fn
Function
The callback that will be execute when the event fires This is wrapped by Y.rbind if obj was supplied.
id
String
Unique subscriber id
once
Unknown
This listener only reacts to the event once