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

Function flushSync

code/higher-order-components/public/app.js:13933–13943  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected