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

Function flushSync

code/styling/public/app.js:13939–13949  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

13937 // TODO: Batching should be implemented at the renderer level, not within
13938 // the reconciler.
13939 function flushSync(fn, a) {
13940 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
13941 var previousIsBatchingUpdates = isBatchingUpdates;
13942 isBatchingUpdates = true;
13943 try {
13944 return syncUpdates(fn, a);
13945 } finally {
13946 isBatchingUpdates = previousIsBatchingUpdates;
13947 performSyncWork();
13948 }
13949 }
13950
13951 function interactiveUpdates(fn, a, b) {
13952 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected