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

Function executeDispatchesInOrder

code/new-context-api/public/app.js:1501–1520  ·  view source on GitHub ↗

* Standard/simple iteration through an event's collected dispatches.

(event, simulated)

Source from the content-addressed store, hash-verified

1499 * Standard/simple iteration through an event's collected dispatches.
1500 */
1501function executeDispatchesInOrder(event, simulated) {
1502 var dispatchListeners = event._dispatchListeners;
1503 var dispatchInstances = event._dispatchInstances;
1504 {
1505 validateEventDispatches(event);
1506 }
1507 if (Array.isArray(dispatchListeners)) {
1508 for (var i = 0; i < dispatchListeners.length; i++) {
1509 if (event.isPropagationStopped()) {
1510 break;
1511 }
1512 // Listeners and Instances are two parallel arrays that are always in sync.
1513 executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
1514 }
1515 } else if (dispatchListeners) {
1516 executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
1517 }
1518 event._dispatchListeners = null;
1519 event._dispatchInstances = null;
1520}
1521
1522/**
1523 * @see executeDispatchesInOrderStopAtTrueImpl

Callers 1

Calls 1

executeDispatchFunction · 0.70

Tested by

no test coverage detected