mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] scheduler: capture requestAnimationFrame asap
This is useful to prevent interactions with other testing code.
This commit is contained in:
committed by
Aaron Bohy
parent
38941bc26f
commit
176c89b278
+1
-1
@@ -25,7 +25,7 @@ export class App<T extends typeof Component = any> extends TemplateSet {
|
||||
Root: T;
|
||||
props: any;
|
||||
env: Env;
|
||||
scheduler = new Scheduler(window.requestAnimationFrame.bind(window));
|
||||
scheduler = new Scheduler();
|
||||
root: ComponentNode | null = null;
|
||||
|
||||
constructor(Root: T, config: AppConfig = {}) {
|
||||
|
||||
@@ -7,11 +7,14 @@ 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);
|
||||
tasks: Set<RootFiber> = new Set();
|
||||
isRunning: boolean = false;
|
||||
requestAnimationFrame: Window["requestAnimationFrame"];
|
||||
|
||||
constructor(requestAnimationFrame: Window["requestAnimationFrame"]) {
|
||||
constructor() {
|
||||
this.requestAnimationFrame = requestAnimationFrame;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user