MCPcopy Create free account
hub / github.com/reactjs/react-rails / scheduleSyncCallback

Function scheduleSyncCallback

lib/assets/react-source/development/react.js:14740–14754  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

14738 return Scheduler_scheduleCallback(priorityLevel, callback, options);
14739 }
14740 function scheduleSyncCallback(callback) {
14741 // Push this callback into an internal queue. We'll flush these either in
14742 // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
14743 if (syncQueue === null) {
14744 syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.
14745
14746 immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
14747 } else {
14748 // Push onto existing queue. Don't need to schedule a callback because
14749 // we already scheduled one when we created the queue.
14750 syncQueue.push(callback);
14751 }
14752
14753 return fakeCallbackNode;
14754 }
14755 function cancelCallback(callbackNode) {
14756 if (callbackNode !== fakeCallbackNode) {
14757 Scheduler_cancelCallback(callbackNode);

Callers 1

ensureRootIsScheduledFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected