🎨 Use window.requestIdleCallback
This commit is contained in:
parent
5c9f18e1ae
commit
4a7cc22de3
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ class IdleDetector extends EventEmitter {
|
|||
|
||||
_scheduleNextCallback() {
|
||||
this.stop();
|
||||
this.handle = requestIdleCallback((deadline) => {
|
||||
this.handle = window.requestIdleCallback((deadline) => {
|
||||
const { didTimeout } = deadline;
|
||||
const timeRemaining = deadline.timeRemaining();
|
||||
const isIdle = timeRemaining >= IDLE_THRESHOLD_MS;
|
||||
|
|
Loading…
Reference in a new issue