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

Function flushSync

code/third-party/public/app.js:13172–13182  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

13170 // TODO: Batching should be implemented at the renderer level, not within
13171 // the reconciler.
13172 function flushSync(fn, a) {
13173 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
13174 var previousIsBatchingUpdates = isBatchingUpdates;
13175 isBatchingUpdates = true;
13176 try {
13177 return syncUpdates(fn, a);
13178 } finally {
13179 isBatchingUpdates = previousIsBatchingUpdates;
13180 performSyncWork();
13181 }
13182 }
13183
13184 function interactiveUpdates(fn, a, b) {
13185 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected