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

Function flushSync

code/communication/public/app.js:13974–13984  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

13972 // TODO: Batching should be implemented at the renderer level, not within
13973 // the reconciler.
13974 function flushSync(fn, a) {
13975 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
13976 var previousIsBatchingUpdates = isBatchingUpdates;
13977 isBatchingUpdates = true;
13978 try {
13979 return syncUpdates(fn, a);
13980 } finally {
13981 isBatchingUpdates = previousIsBatchingUpdates;
13982 performSyncWork();
13983 }
13984 }
13985
13986 function interactiveUpdates(fn, a, b) {
13987 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected