Yahoo! UI Library

event  3.3.0pr1

Yahoo! UI Library > event > SyntheticEvent.Notifier
Search:
 
Filters

private Class SyntheticEvent.Notifier

The triggering mechanism used by SyntheticEvents.

Implementers should not instantiate these directly. Use the Notifier provided to the event's implemented on(node, sub, notifier) or delegate(node, sub, notifier, filter) methods.

Constructor

SyntheticEvent.Notifier ( handle , emitFacade )
Parameters:
handle <EventHandle> the detach handle for the subscription to an internal custom event used to execute the callback passed to on(..) or delegate(..)
emitFacade <Boolean> take steps to ensure the first arg received by the subscription callback is an event facade

Methods

fire

private void fire ( e , arg* )

Executes the subscription callback, passing the firing arguments as the first parameters to that callback. For events that are configured with emitFacade=true, it is common practice to pass the triggering DOMEventFacade as the first parameter. Barring a proper DOMEventFacade or EventFacade (from a CustomEvent), a new EventFacade will be generated. In that case, if fire() is called with a simple object, it will be mixed into the facade. Otherwise, the facade will be prepended to the callback parameters.

For notifiers provided to delegate logic, the first argument should be an object with a "currentTarget" property to identify what object to default as 'this' in the callback. Typically this is gleaned from the DOMEventFacade or EventFacade, but if configured with emitFacade=false, an object must be provided. In that case, the object will be removed from the callback parameters.

Additional arguments passed during event subscription will be automatically added after those passed to fire().

Parameters:
e <EventFacade|DOMEventFacade|Object|any> (see description)
arg* <any> additional arguments received by all subscriptions


Copyright © 2010 Yahoo! Inc. All rights reserved.