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

Function flushSync

code/one-direction-data-flow/public/app.js:13812–13822  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

13810 // TODO: Batching should be implemented at the renderer level, not within
13811 // the reconciler.
13812 function flushSync(fn, a) {
13813 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
13814 var previousIsBatchingUpdates = isBatchingUpdates;
13815 isBatchingUpdates = true;
13816 try {
13817 return syncUpdates(fn, a);
13818 } finally {
13819 isBatchingUpdates = previousIsBatchingUpdates;
13820 performSyncWork();
13821 }
13822 }
13823
13824 function interactiveUpdates(fn, a, b) {
13825 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected