Show:
Module: event-synthetic
Parent Module: event

Available since 3.2.0

<p>The triggering mechanism used by SyntheticEvents.</p>

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

Constructor

SyntheticEvent.Notifier

(
  • handle
  • emitFacade
)
private

Defined in yui3/src/event/js/synthetic.js:17

Available since 3.2.0

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

Index

Methods

Methods

fire

(
  • e
  • [arg*]
)
private

<p>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.</p>

<p>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.</p>

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

Parameters:

  • e EventFacade | DOMEventFacade | Any

    (see description)

  • [arg*] Any optional

    additional arguments received by all subscriptions