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

Function runEventsInBatch

code/dependency-injection/public/app.js:2471–2493  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

2469}
2470
2471function runEventsInBatch(events, simulated) {
2472 if (events !== null) {
2473 eventQueue = accumulateInto(eventQueue, events);
2474 }
2475
2476 // Set `eventQueue` to null before processing it so that we can tell if more
2477 // events get enqueued while processing.
2478 var processingEventQueue = eventQueue;
2479 eventQueue = null;
2480
2481 if (!processingEventQueue) {
2482 return;
2483 }
2484
2485 if (simulated) {
2486 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2487 } else {
2488 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2489 }
2490 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
2491 // This would be a good time to rethrow if any of the event handlers threw.
2492 ReactErrorUtils.rethrowCaughtError();
2493}
2494
2495function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2496 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