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

Function runEventsInBatch

code/communication/public/app.js:2413–2435  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

2411}
2412
2413function runEventsInBatch(events, simulated) {
2414 if (events !== null) {
2415 eventQueue = accumulateInto(eventQueue, events);
2416 }
2417
2418 // Set `eventQueue` to null before processing it so that we can tell if more
2419 // events get enqueued while processing.
2420 var processingEventQueue = eventQueue;
2421 eventQueue = null;
2422
2423 if (!processingEventQueue) {
2424 return;
2425 }
2426
2427 if (simulated) {
2428 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2429 } else {
2430 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2431 }
2432 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
2433 // This would be a good time to rethrow if any of the event handlers threw.
2434 ReactErrorUtils.rethrowCaughtError();
2435}
2436
2437function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2438 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