core/dispatcher
Provides methods to add and remove global event listeners.
Members
Section titled “Members ”off Function
Section titled “off   Function ”off( name, fn, target ) → undefinedRemoves a global event listener.
3 Params
- name String
Event name
- fn Function
Event handler
- target Nodedefault: `document`
Event listener target
Returns
- undefined
on Function
Section titled “on   Function ”on( name, fn, target ) → undefinedAdds a new global event listener. Duplicate event handlers will be discarded.
3 Params
- name String
Event name
- fn Function
Event handler
- target Nodedefault: 'document'
Event listener target
Returns
- undefined
once Function
Section titled “once   Function ”once( name, fn, {target} ) → FunctionAdds a new global event listener that removes itself after handling one event.
3 Params
- name String
Event name
- fn Function
Event handler
- Optional • target Node
Event listener target
Returns
- Function
The single-use handler. To remove the handler manually, call the
off()function with this as the 2nd parameter.