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

Function extractEvents

code/controlled-uncontrolled/public/app.js:1687–1700  ·  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

1685 * @internal
1686 */
1687function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1688 var events = null;
1689 for (var i = 0; i < plugins.length; i++) {
1690 // Not every plugin in the ordering may be loaded at runtime.
1691 var possiblePlugin = plugins[i];
1692 if (possiblePlugin) {
1693 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
1694 if (extractedEvents) {
1695 events = accumulateInto(events, extractedEvents);
1696 }
1697 }
1698 }
1699 return events;
1700}
1701
1702function runEventsInBatch(events, simulated) {
1703 if (events !== null) {

Callers 1

Calls 1

accumulateIntoFunction · 0.70

Tested by

no test coverage detected