From 5f24caf40d4fdffae5e84d2f339450934d15de6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 20 Jan 2022 10:31:33 +0100 Subject: [PATCH] [FIX] scheduler: make sure raf is bound to window --- src/component/scheduler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/scheduler.ts b/src/component/scheduler.ts index 3a8e4be4..dbcb4197 100644 --- a/src/component/scheduler.ts +++ b/src/component/scheduler.ts @@ -9,13 +9,13 @@ import { STATUS } from "./status"; export class Scheduler { // capture the value of requestAnimationFrame as soon as possible, to avoid // interactions with other code, such as test frameworks that override them - static requestAnimationFrame = window.requestAnimationFrame.bind(this); + static requestAnimationFrame = window.requestAnimationFrame.bind(window); tasks: Set = new Set(); isRunning: boolean = false; requestAnimationFrame: Window["requestAnimationFrame"]; constructor() { - this.requestAnimationFrame = requestAnimationFrame; + this.requestAnimationFrame = Scheduler.requestAnimationFrame; } start() {