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

Function getPriorityContext

bundle.js:7933–7935  ·  view source on GitHub ↗
(fiber,forceAsync)

Source from the content-addressed store, hash-verified

7931performWork(SynchronousPriority$1,null);}else{// Flush both synchronous and task work.
7932performWork(TaskPriority$1,null);}break;case TaskPriority$1:!isBatchingUpdates?invariant(false,'Task updates can only be scheduled as a nested update or inside batchedUpdates.'):void 0;break;default:// Schedule a callback to perform the work later.
7933if(!isCallbackScheduled){scheduleDeferredCallback(performDeferredWork);isCallbackScheduled=true;}}}}else{{if(!isErrorRecovery&&fiber.tag===ClassComponent$5){warnAboutUpdateOnUnmounted(fiber.stateNode);}}return;}}node=node['return'];}}function getPriorityContext(fiber,forceAsync){var priorityLevel=priorityContext;if(priorityLevel===NoWork$2){if(!useSyncScheduling||fiber.internalContextTag&AsyncUpdates||forceAsync){priorityLevel=LowPriority;}else{priorityLevel=SynchronousPriority$1;}}// If we're in a batch, or if we're already performing work, downgrade sync
7934// priority to task priority
7935if(priorityLevel===SynchronousPriority$1&&(isPerformingWork||isBatchingUpdates)){return TaskPriority$1;}return priorityLevel;}function scheduleErrorRecovery(fiber){scheduleUpdateImpl(fiber,TaskPriority$1,true);}function batchedUpdates(fn,a){var previousIsBatchingUpdates=isBatchingUpdates;isBatchingUpdates=true;try{return fn(a);}finally{isBatchingUpdates=previousIsBatchingUpdates;// If we're not already inside a batch, we need to flush any task work
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};};/**

Callers 2

ReactFiberClassComponentFunction · 0.85
scheduleTopLevelUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected