MCPcopy
hub / github.com/plotly/dash / flushSyncCallbacks

Function flushSyncCallbacks

dash/deps/react-dom@18.2.0.js:12034–12074  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12032 }
12033 }
12034 function flushSyncCallbacks() {
12035 if (!isFlushingSyncQueue && syncQueue !== null) {
12036 // Prevent re-entrance.
12037 isFlushingSyncQueue = true;
12038 var i = 0;
12039 var previousUpdatePriority = getCurrentUpdatePriority();
12040
12041 try {
12042 var isSync = true;
12043 var queue = syncQueue; // TODO: Is this necessary anymore? The only user code that runs in this
12044 // queue is in the render or commit phases.
12045
12046 setCurrentUpdatePriority(DiscreteEventPriority);
12047
12048 for (; i < queue.length; i++) {
12049 var callback = queue[i];
12050
12051 do {
12052 callback = callback(isSync);
12053 } while (callback !== null);
12054 }
12055
12056 syncQueue = null;
12057 includesLegacySyncCallbacks = false;
12058 } catch (error) {
12059 // If something throws, leave the remaining callbacks on the queue.
12060 if (syncQueue !== null) {
12061 syncQueue = syncQueue.slice(i + 1);
12062 } // Resume flushing in the next tick
12063
12064
12065 scheduleCallback(ImmediatePriority, flushSyncCallbacks);
12066 throw error;
12067 } finally {
12068 setCurrentUpdatePriority(previousUpdatePriority);
12069 isFlushingSyncQueue = false;
12070 }
12071 }
12072
12073 return null;
12074 }
12075
12076 // TODO: Use the unified fiber stack module instead of this local one?
12077 // Intentionally not using it yet to derisk the initial implementation, because

Callers 6

ensureRootIsScheduledFunction · 0.70
flushRootFunction · 0.70
flushSyncFunction · 0.70
commitRootImplFunction · 0.70
flushPassiveEffectsImplFunction · 0.70

Calls 4

scheduleCallbackFunction · 0.85
getCurrentUpdatePriorityFunction · 0.70
setCurrentUpdatePriorityFunction · 0.70
callbackFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…