MCPcopy Create free account
hub / github.com/danielstocks/react-sortable / flushSync

Function flushSync

bundle.js:7938–7938  ·  view source on GitHub ↗
(batch)

Source from the content-addressed store, hash-verified

7936// that was created by the user-provided function.
7937if(!isPerformingWork&&!isBatchingUpdates){performWork(TaskPriority$1,null);}}}function unbatchedUpdates(fn){var previousIsUnbatchingUpdates=isUnbatchingUpdates;var previousIsBatchingUpdates=isBatchingUpdates;// This is only true if we're nested inside batchedUpdates.
7938isUnbatchingUpdates=isBatchingUpdates;isBatchingUpdates=false;try{return fn();}finally{isBatchingUpdates=previousIsBatchingUpdates;isUnbatchingUpdates=previousIsUnbatchingUpdates;}}function flushSync(batch){var previousIsBatchingUpdates=isBatchingUpdates;var previousPriorityContext=priorityContext;isBatchingUpdates=true;priorityContext=SynchronousPriority$1;try{return batch();}finally{isBatchingUpdates=previousIsBatchingUpdates;priorityContext=previousPriorityContext;!!isPerformingWork?invariant(false,'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.'):void 0;performWork(TaskPriority$1,null);}}function deferredUpdates(fn){var previousPriorityContext=priorityContext;priorityContext=LowPriority;try{return fn();}finally{priorityContext=previousPriorityContext;}}return{scheduleUpdate:scheduleUpdate,getPriorityContext:getPriorityContext,batchedUpdates:batchedUpdates,unbatchedUpdates:unbatchedUpdates,flushSync:flushSync,deferredUpdates:deferredUpdates};};/**
7939 * Copyright (c) 2013-present, Facebook, Inc.
7940 *
7941 * This source code is licensed under the MIT license found in the

Callers

nothing calls this directly

Calls 2

performWorkFunction · 0.85
invariantFunction · 0.70

Tested by

no test coverage detected