File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
libs/cdk/internals/scheduler/src/lib Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ import { PriorityLevel } from './schedulerPriorities';
18
18
*/
19
19
declare const ngDevMode : boolean ;
20
20
21
+ const isPostTaskSupported =
22
+ typeof ɵglobal . scheduler !== 'undefined' &&
23
+ typeof ɵglobal . scheduler . postTask === 'function' ;
24
+
21
25
let getCurrentTime : ( ) => number ;
22
26
const hasPerformanceNow =
23
27
typeof ɵglobal . performance === 'object' &&
@@ -561,7 +565,9 @@ if (typeof setImmediate === 'function') {
561
565
562
566
function requestHostCallback ( callback ) {
563
567
scheduledHostCallback = callback ;
564
- if ( ! isMessageLoopRunning ) {
568
+ if ( isPostTaskSupported ) {
569
+ ɵglobal . scheduler . postTask ( performWorkUntilDeadline ) ;
570
+ } else if ( ! isMessageLoopRunning ) {
565
571
isMessageLoopRunning = true ;
566
572
schedulePerformWorkUntilDeadline ( ) ;
567
573
}
You can’t perform that action at this time.
0 commit comments