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

Function flushSync

code/dependency-injection/public/app.js:14032–14042  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

14030 // TODO: Batching should be implemented at the renderer level, not within
14031 // the reconciler.
14032 function flushSync(fn, a) {
14033 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
14034 var previousIsBatchingUpdates = isBatchingUpdates;
14035 isBatchingUpdates = true;
14036 try {
14037 return syncUpdates(fn, a);
14038 } finally {
14039 isBatchingUpdates = previousIsBatchingUpdates;
14040 performSyncWork();
14041 }
14042 }
14043
14044 function interactiveUpdates(fn, a, b) {
14045 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected