File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,12 @@ interface Scheduler {
2626}
2727declare const scheduler : Scheduler ;
2828
29- // 'user-blocking' runs right after microtasks, so equivalent to setTimeout but without the 4ms clamping
29+ // 'postTask' runs right after microtasks, so equivalent to setTimeout but without the 4ms clamping.
30+ // Using the default priority of 'user-visible' to avoid blocking input while still running fairly quickly.
31+ // See: https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API#task_priorities
3032const schedulerPostTask =
3133 typeof scheduler !== "undefined" &&
32- ( ( fn : ( ) => void ) => scheduler . postTask ( fn , { priority : "user-blocking" } ) ) ;
34+ ( ( fn : ( ) => void ) => scheduler . postTask ( fn ) ) ;
3335
3436// fallback for environments that don't support any of the above
3537const doSetTimeout = ( fn : ( ) => void ) => setTimeout ( fn , 0 ) ;
You can’t perform that action at this time.
0 commit comments