From 1d4f481e6511200d1aef1454dbc0dba003d7e12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Thu, 13 Apr 2023 08:30:58 +0000 Subject: [PATCH] refactor: remove unused budget option --- packages/frontend/src/scripts/idle-render.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/scripts/idle-render.ts b/packages/frontend/src/scripts/idle-render.ts index 838304d1b3..ccce8b02bf 100644 --- a/packages/frontend/src/scripts/idle-render.ts +++ b/packages/frontend/src/scripts/idle-render.ts @@ -1,19 +1,16 @@ -// eslint-disable-next-line import/no-default-export -export default class IdlingRenderScheduler { +class IdlingRenderScheduler { #renderers: Set; - #budget: number; #rafId: number; #ricId: number; - constructor(budget = 0) { + constructor() { this.#renderers = new Set(); - this.#budget = budget; this.#rafId = 0; this.#ricId = requestIdleCallback((deadline) => this.#schedule(deadline)); } #schedule(deadline: IdleDeadline): void { - if (deadline.timeRemaining() > this.#budget) { + if (deadline.timeRemaining()) { this.#rafId = requestAnimationFrame((time) => { for (const renderer of this.#renderers) { renderer(time);