MCPcopy
hub / github.com/react/react / unstable_runWithPriority

Function unstable_runWithPriority

packages/scheduler/src/forks/SchedulerPostTask.js:181–192  ·  view source on GitHub ↗
(
  priorityLevel: PriorityLevel,
  callback: () => T,
)

Source from the content-addressed store, hash-verified

179}
180
181export function unstable_runWithPriority<T>(
182 priorityLevel: PriorityLevel,
183 callback: () => T,
184): T {
185 const previousPriorityLevel = currentPriorityLevel_DEPRECATED;
186 currentPriorityLevel_DEPRECATED = priorityLevel;
187 try {
188 return callback();
189 } finally {
190 currentPriorityLevel_DEPRECATED = previousPriorityLevel;
191 }
192}
193
194export function unstable_getCurrentPriorityLevel(): PriorityLevel {
195 return currentPriorityLevel_DEPRECATED;

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected