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

Function runEventsInBatch

code/redux/public/app.js:2629–2651  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

2627}
2628
2629function runEventsInBatch(events, simulated) {
2630 if (events !== null) {
2631 eventQueue = accumulateInto(eventQueue, events);
2632 }
2633
2634 // Set `eventQueue` to null before processing it so that we can tell if more
2635 // events get enqueued while processing.
2636 var processingEventQueue = eventQueue;
2637 eventQueue = null;
2638
2639 if (!processingEventQueue) {
2640 return;
2641 }
2642
2643 if (simulated) {
2644 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2645 } else {
2646 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2647 }
2648 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
2649 // This would be a good time to rethrow if any of the event handlers threw.
2650 ReactErrorUtils.rethrowCaughtError();
2651}
2652
2653function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2654 var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);

Callers 2

runEventInBatchFunction · 0.70

Calls 3

accumulateIntoFunction · 0.70
forEachAccumulatedFunction · 0.70
invariantFunction · 0.70

Tested by

no test coverage detected