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

Function runEventsInBatch

code/composition/public/app.js:2516–2538  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

2514}
2515
2516function runEventsInBatch(events, simulated) {
2517 if (events !== null) {
2518 eventQueue = accumulateInto(eventQueue, events);
2519 }
2520
2521 // Set `eventQueue` to null before processing it so that we can tell if more
2522 // events get enqueued while processing.
2523 var processingEventQueue = eventQueue;
2524 eventQueue = null;
2525
2526 if (!processingEventQueue) {
2527 return;
2528 }
2529
2530 if (simulated) {
2531 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2532 } else {
2533 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2534 }
2535 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
2536 // This would be a good time to rethrow if any of the event handlers threw.
2537 ReactErrorUtils.rethrowCaughtError();
2538}
2539
2540function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2541 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