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

Function flushSync

code/controlled-uncontrolled/public/app.js:13263–13273  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

13261 // TODO: Batching should be implemented at the renderer level, not within
13262 // the reconciler.
13263 function flushSync(fn, a) {
13264 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
13265 var previousIsBatchingUpdates = isBatchingUpdates;
13266 isBatchingUpdates = true;
13267 try {
13268 return syncUpdates(fn, a);
13269 } finally {
13270 isBatchingUpdates = previousIsBatchingUpdates;
13271 performSyncWork();
13272 }
13273 }
13274
13275 function interactiveUpdates(fn, a, b) {
13276 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected