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

Function extractEvents

code/one-direction-data-flow/public/app.js:2236–2249  ·  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

2234 * @internal
2235 */
2236function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2237 var events = null;
2238 for (var i = 0; i < plugins.length; i++) {
2239 // Not every plugin in the ordering may be loaded at runtime.
2240 var possiblePlugin = plugins[i];
2241 if (possiblePlugin) {
2242 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2243 if (extractedEvents) {
2244 events = accumulateInto(events, extractedEvents);
2245 }
2246 }
2247 }
2248 return events;
2249}
2250
2251function runEventsInBatch(events, simulated) {
2252 if (events !== null) {

Callers 1

Calls 1

accumulateIntoFunction · 0.70

Tested by

no test coverage detected