Yahoo! UI Library

event  3.0.0pr2

Yahoo! UI Library > event > Event.Subscriber
Search:
 
Filters

Class Event.Subscriber

Stores the subscriber information to be used when the event fires.

Constructor

Event.Subscriber ( fn , obj , args )
Parameters:
fn <Function> The wrapped function to execute
obj <Object> An object to be passed along when the event fires
args <Array> subscribe() additional arguments

Properties

args - Array

Optional additional arguments supplied to subscribe(). If present, these will be appended to the arguments supplied to fire()

fn - Function

The callback that will be execute when the event fires This is wrapped by Y.bind if obj was supplied.

id - String

Unique subscriber id

obj - Object

An optional custom object that will passed to the callback when the event fires

wrappedFn - Function

} fn bound to obj with additional arguments applied via Y.bind

Methods

contains

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:
fn <Function> the function to execute
obj <Object> an object to be passed along when the event fires
Returns: boolean
true if the supplied arguments match this subscriber's signature.

notify

void notify ( defaultContext , args , ce )
Executes the subscriber.
Parameters:
defaultContext <object> The execution context if not overridden by the subscriber
args <Array> Arguments array for the subscriber
ce <Event.Custom> The custom event that sent the notification
Returns: void

toString

void toString ( )
Returns: void


Copyright © 2008 Yahoo! Inc. All rights reserved.