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

Function runEventsInBatch

code/controlled-uncontrolled/public/app.js:1702–1724  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

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