MCPcopy
hub / github.com/facebook/react / unstable_wrapCallback

Function unstable_wrapCallback

packages/scheduler/src/forks/SchedulerPostTask.js:222–233  ·  view source on GitHub ↗
(callback: () => T)

Source from the content-addressed store, hash-verified

220}
221
222export function unstable_wrapCallback<T>(callback: () => T): () => T {
223 const parentPriorityLevel = currentPriorityLevel_DEPRECATED;
224 return () => {
225 const previousPriorityLevel = currentPriorityLevel_DEPRECATED;
226 currentPriorityLevel_DEPRECATED = parentPriorityLevel;
227 try {
228 return callback();
229 } finally {
230 currentPriorityLevel_DEPRECATED = previousPriorityLevel;
231 }
232 };
233}
234
235export function unstable_forceFrameRate() {}
236

Callers

nothing calls this directly

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected