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

Function extractEvents

code/composition/public/app.js:2501–2514  ·  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

2499 * @internal
2500 */
2501function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2502 var events = null;
2503 for (var i = 0; i < plugins.length; i++) {
2504 // Not every plugin in the ordering may be loaded at runtime.
2505 var possiblePlugin = plugins[i];
2506 if (possiblePlugin) {
2507 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2508 if (extractedEvents) {
2509 events = accumulateInto(events, extractedEvents);
2510 }
2511 }
2512 }
2513 return events;
2514}
2515
2516function runEventsInBatch(events, simulated) {
2517 if (events !== null) {

Callers 1

Calls 1

accumulateIntoFunction · 0.70

Tested by

no test coverage detected