MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / trapBubbledEvent

Function trapBubbledEvent

code/redux/public/app.js:6136–6145  ·  view source on GitHub ↗

* Traps top-level events by using event bubbling. * * @param {string} topLevelType Record from `BrowserEventConstants`. * @param {string} handlerBaseName Event name (e.g. "click"). * @param {object} element Element on which to attach listener. * @return {?object} An object with a remove functio

(topLevelType, handlerBaseName, element)

Source from the content-addressed store, hash-verified

6134 * @internal
6135 */
6136function trapBubbledEvent(topLevelType, handlerBaseName, element) {
6137 if (!element) {
6138 return null;
6139 }
6140 var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent;
6141
6142 addEventBubbleListener(element, handlerBaseName,
6143 // Check if interactive and wrap in interactiveUpdates
6144 dispatch.bind(null, topLevelType));
6145}
6146
6147/**
6148 * Traps a top-level event by using event capturing.

Callers 3

listenToFunction · 0.70
setInitialProperties$1Function · 0.70
diffHydratedProperties$1Function · 0.70

Calls 1

addEventBubbleListenerFunction · 0.70

Tested by

no test coverage detected