MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / runEventsInBatch

Function runEventsInBatch

code/new-context-api/public/app.js:1739–1761  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

1737}
1738
1739function runEventsInBatch(events, simulated) {
1740 if (events !== null) {
1741 eventQueue = accumulateInto(eventQueue, events);
1742 }
1743
1744 // Set `eventQueue` to null before processing it so that we can tell if more
1745 // events get enqueued while processing.
1746 var processingEventQueue = eventQueue;
1747 eventQueue = null;
1748
1749 if (!processingEventQueue) {
1750 return;
1751 }
1752
1753 if (simulated) {
1754 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
1755 } else {
1756 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
1757 }
1758 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
1759 // This would be a good time to rethrow if any of the event handlers threw.
1760 ReactErrorUtils.rethrowCaughtError();
1761}
1762
1763function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1764 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