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

Function flushSync

code/composition/public/app.js:14077–14087  ·  view source on GitHub ↗
(fn, a)

Source from the content-addressed store, hash-verified

14075 // TODO: Batching should be implemented at the renderer level, not within
14076 // the reconciler.
14077 function flushSync(fn, a) {
14078 !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
14079 var previousIsBatchingUpdates = isBatchingUpdates;
14080 isBatchingUpdates = true;
14081 try {
14082 return syncUpdates(fn, a);
14083 } finally {
14084 isBatchingUpdates = previousIsBatchingUpdates;
14085 performSyncWork();
14086 }
14087 }
14088
14089 function interactiveUpdates(fn, a, b) {
14090 if (isBatchingInteractiveUpdates) {

Callers

nothing calls this directly

Calls 3

invariantFunction · 0.70
syncUpdatesFunction · 0.70
performSyncWorkFunction · 0.70

Tested by

no test coverage detected