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

Function runEventsInBatch

code/one-direction-data-flow/public/app.js:2251–2273  ·  view source on GitHub ↗
(events, simulated)

Source from the content-addressed store, hash-verified

2249}
2250
2251function runEventsInBatch(events, simulated) {
2252 if (events !== null) {
2253 eventQueue = accumulateInto(eventQueue, events);
2254 }
2255
2256 // Set `eventQueue` to null before processing it so that we can tell if more
2257 // events get enqueued while processing.
2258 var processingEventQueue = eventQueue;
2259 eventQueue = null;
2260
2261 if (!processingEventQueue) {
2262 return;
2263 }
2264
2265 if (simulated) {
2266 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2267 } else {
2268 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2269 }
2270 !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
2271 // This would be a good time to rethrow if any of the event handlers threw.
2272 ReactErrorUtils.rethrowCaughtError();
2273}
2274
2275function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2276 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