MCPcopy
hub / github.com/aosabook/500lines / executeDirectDispatch

Function executeDirectDispatch

spreadsheet/code/as-react-livescript/main.js:6190–6206  ·  view source on GitHub ↗

* Execution of a "direct" dispatch - there must be at most one dispatch * accumulated on the event or it is considered an error. It doesn't really make * sense for an event with multiple dispatches (bubbled) to keep track of the * return values at each dispatch execution, but it does tend to m

(event)

Source from the content-addressed store, hash-verified

6188 * @return The return value of executing the single dispatch.
6189 */
6190 function executeDirectDispatch(event) {
6191 if ("production" !== process.env.NODE_ENV) {
6192 validateEventDispatches(event);
6193 }
6194 var dispatchListener = event._dispatchListeners;
6195 var dispatchID = event._dispatchIDs;
6196 ("production" !== process.env.NODE_ENV ? invariant(
6197 !Array.isArray(dispatchListener),
6198 'executeDirectDispatch(...): Invalid `event`.'
6199 ) : invariant(!Array.isArray(dispatchListener)));
6200 var res = dispatchListener ?
6201 dispatchListener(event, dispatchID) :
6202 null;
6203 event._dispatchListeners = null;
6204 event._dispatchIDs = null;
6205 return res;
6206 }
6207
6208 /**
6209 * @param {SyntheticEvent} event

Callers

nothing calls this directly

Calls 1

invariantFunction · 0.85

Tested by

no test coverage detected