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

Function runEventsInBatch

code/third-party/public/app.js:1611–1633  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

1609}
1610
1611function runEventsInBatch(events, simulated) {
1612 if (events !== null) {
1613 eventQueue = accumulateInto(eventQueue, events);
1614 }
1615
1616 // Set `eventQueue` to null before processing it so that we can tell if more
1617 // events get enqueued while processing.
1618 var processingEventQueue = eventQueue;
1619 eventQueue = null;
1620
1621 if (!processingEventQueue) {
1622 return;
1623 }
1624
1625 if (simulated) {
1626 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
1627 } else {
1628 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
1629 }
1630 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
1631 // This would be a good time to rethrow if any of the event handlers threw.
1632 ReactErrorUtils.rethrowCaughtError();
1633}
1634
1635function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1636 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