MCPcopy Create free account
hub / github.com/microsoft/SandDance / unstable_runWithPriority

Function unstable_runWithPriority

docs/external/js/react.development.js:2668–2689  ·  view source on GitHub ↗
(priorityLevel, eventHandler)

Source from the content-addressed store, hash-verified

2666 }
2667
2668 function unstable_runWithPriority(priorityLevel, eventHandler) {
2669 switch (priorityLevel) {
2670 case ImmediatePriority:
2671 case UserBlockingPriority:
2672 case NormalPriority:
2673 case LowPriority:
2674 case IdlePriority:
2675 break;
2676
2677 default:
2678 priorityLevel = NormalPriority;
2679 }
2680
2681 var previousPriorityLevel = currentPriorityLevel;
2682 currentPriorityLevel = priorityLevel;
2683
2684 try {
2685 return eventHandler();
2686 } finally {
2687 currentPriorityLevel = previousPriorityLevel;
2688 }
2689 }
2690
2691 function unstable_next(eventHandler) {
2692 var priorityLevel;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected