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

Function runEventsInBatch

code/event-handlers/public/app.js:1708–1730  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

1706}
1707
1708function runEventsInBatch(events, simulated) {
1709 if (events !== null) {
1710 eventQueue = accumulateInto(eventQueue, events);
1711 }
1712
1713 // Set `eventQueue` to null before processing it so that we can tell if more
1714 // events get enqueued while processing.
1715 var processingEventQueue = eventQueue;
1716 eventQueue = null;
1717
1718 if (!processingEventQueue) {
1719 return;
1720 }
1721
1722 if (simulated) {
1723 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
1724 } else {
1725 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
1726 }
1727 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
1728 // This would be a good time to rethrow if any of the event handlers threw.
1729 ReactErrorUtils.rethrowCaughtError();
1730}
1731
1732function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1733 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