SyntheticEvent.Notifier Class
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
EventHandlethe detach handle for the subscription to an internal custom event used to execute the callback passed to on(..) or delegate(..)
-
emitFacade
Booleantake steps to ensure the first arg received by the subscription callback is an event facade
Item Index
Methods
Methods
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 multipleadditional arguments received by all subscriptions