Class SyntheticEvent.Notifier
Triggering mechanism used by SyntheticEvents. The logic defining the
actions taken during each subscription receives a Notifier to fire when the
conditions for firing are eventually met. Typically, this involves firing
the notifier from the callback of other DOM subscriptions subscriptions.
Implementers should probably not instantiate these directly.
Constructor
SyntheticEvent.Notifier
(
handle
,
emitFacade
,
delegate
)
- 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
-
delegate
<Boolean>
was this subscription from a call to delegate(..)?
Methods
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