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

Function unstable_cancelCallback

packages/scheduler/src/forks/SchedulerMock.js:416–429  ·  view source on GitHub ↗
(task: Task)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

markTaskCanceledFunction · 0.90
getCurrentTimeFunction · 0.70

Tested by

no test coverage detected