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

Function unstable_cancelCallback

packages/scheduler/src/forks/Scheduler.js:418–431  ·  view source on GitHub ↗
(task: Task)

Source from the content-addressed store, hash-verified

416}
417
418function unstable_cancelCallback(task: Task) {
419 if (enableProfiling) {
420 if (task.isQueued) {
421 const currentTime = getCurrentTime();
422 markTaskCanceled(task, currentTime);
423 task.isQueued = false;
424 }
425 }
426
427 // Null out the callback to indicate the task has been canceled. (Can't
428 // remove from the queue because you can't remove arbitrary nodes from an
429 // array based heap, only the first one.)
430 task.callback = null;
431}
432
433function unstable_getCurrentPriorityLevel(): PriorityLevel {
434 return currentPriorityLevel;

Callers

nothing calls this directly

Calls 2

markTaskCanceledFunction · 0.90
getCurrentTimeFunction · 0.70

Tested by

no test coverage detected