MCPcopy Index your code
hub / github.com/microsoft/SandDance / flushDiscreteUpdates

Function flushDiscreteUpdates

docs/external/js/react-dom.development.js:21944–21966  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21942 commitRoot(root);
21943 }
21944 function flushDiscreteUpdates() {
21945 // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.
21946 // However, `act` uses `batchedUpdates`, so there's no way to distinguish
21947 // those two cases. Need to fix this before exposing flushDiscreteUpdates
21948 // as a public API.
21949 if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
21950 {
21951 if ((executionContext & RenderContext) !== NoContext) {
21952 error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
21953 }
21954 } // We're already rendering, so we can't synchronously flush pending work.
21955 // This is probably a nested event dispatch triggered by a lifecycle/effect,
21956 // like `el.focus()`. Exit.
21957
21958
21959 return;
21960 }
21961
21962 flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that
21963 // they fire before the next serial event.
21964
21965 flushPassiveEffects();
21966 }
21967 function syncUpdates(fn, a, b, c) {
21968 return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c));
21969 }

Callers

nothing calls this directly

Calls 3

flushPassiveEffectsFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected