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

Function unstable_next

docs/external/js/react.development.js:2691–2716  ·  view source on GitHub ↗
(eventHandler)

Source from the content-addressed store, hash-verified

2689 }
2690
2691 function unstable_next(eventHandler) {
2692 var priorityLevel;
2693
2694 switch (currentPriorityLevel) {
2695 case ImmediatePriority:
2696 case UserBlockingPriority:
2697 case NormalPriority:
2698 // Shift down to normal priority
2699 priorityLevel = NormalPriority;
2700 break;
2701
2702 default:
2703 // Anything lower than normal priority should remain at the current level.
2704 priorityLevel = currentPriorityLevel;
2705 break;
2706 }
2707
2708 var previousPriorityLevel = currentPriorityLevel;
2709 currentPriorityLevel = priorityLevel;
2710
2711 try {
2712 return eventHandler();
2713 } finally {
2714 currentPriorityLevel = previousPriorityLevel;
2715 }
2716 }
2717
2718 function unstable_wrapCallback(callback) {
2719 var parentPriorityLevel = currentPriorityLevel;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected