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

Function runEventsInBatch

code/styling/public/app.js:2378–2400  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

2376}
2377
2378function runEventsInBatch(events, simulated) {
2379 if (events !== null) {
2380 eventQueue = accumulateInto(eventQueue, events);
2381 }
2382
2383 // Set `eventQueue` to null before processing it so that we can tell if more
2384 // events get enqueued while processing.
2385 var processingEventQueue = eventQueue;
2386 eventQueue = null;
2387
2388 if (!processingEventQueue) {
2389 return;
2390 }
2391
2392 if (simulated) {
2393 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2394 } else {
2395 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2396 }
2397 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
2398 // This would be a good time to rethrow if any of the event handlers threw.
2399 ReactErrorUtils.rethrowCaughtError();
2400}
2401
2402function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2403 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