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

Function flushSync

code/new-context-api/public/app.js:13300–13310  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

13298 // TODO: Batching should be implemented at the renderer level, not within
13299 // the reconciler.
13300 function flushSync(fn, a) {
13301 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
13302 var previousIsBatchingUpdates = isBatchingUpdates;
13303 isBatchingUpdates = true;
13304 try {
13305 return syncUpdates(fn, a);
13306 } finally {
13307 isBatchingUpdates = previousIsBatchingUpdates;
13308 performSyncWork();
13309 }
13310 }
13311
13312 function interactiveUpdates(fn, a, b) {
13313 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected