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

Function extractEvents

code/higher-order-components/public/app.js:2357–2370  ·  view source on GitHub ↗

* Allows registered plugins an opportunity to extract events from top-level * native browser events. * * @return {*} An accumulation of synthetic events. * @internal

(topLevelType, targetInst, nativeEvent, nativeEventTarget)

Source from the content-addressed store, hash-verified

2355 * @internal
2356 */
2357function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2358 var events = null;
2359 for (var i = 0; i < plugins.length; i++) {
2360 // Not every plugin in the ordering may be loaded at runtime.
2361 var possiblePlugin = plugins[i];
2362 if (possiblePlugin) {
2363 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2364 if (extractedEvents) {
2365 events = accumulateInto(events, extractedEvents);
2366 }
2367 }
2368 }
2369 return events;
2370}
2371
2372function runEventsInBatch(events, simulated) {
2373 if (events !== null) {

Callers 1

Calls 1

accumulateIntoFunction · 0.70

Tested by

no test coverage detected