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

Function runEventsInBatch

code/higher-order-components/public/app.js:2372–2394  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

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