Skip to content

Commit

Permalink
Avoid using class scope for timers (#558)
Browse files Browse the repository at this point in the history
* avoid using class scope for timers

* fix copy paste error

* protocol
  • Loading branch information
lukasIO authored Jan 23, 2023
1 parent 100ac49 commit f96c339
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/room/timers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
* that the timer fires on time.
*/
export default class CriticalTimers {
static setTimeout = setTimeout;
// eslint-disable-next-line @typescript-eslint/no-implied-eval
static setTimeout = (...args: Parameters<typeof setTimeout>) => setTimeout(...args);

static setInterval = setInterval;
// eslint-disable-next-line @typescript-eslint/no-implied-eval
static setInterval = (...args: Parameters<typeof setInterval>) => setInterval(...args);

static clearTimeout = clearTimeout;
static clearTimeout = (...args: Parameters<typeof clearTimeout>) => clearTimeout(...args);

static clearInterval = clearInterval;
static clearInterval = (...args: Parameters<typeof clearInterval>) => clearInterval(...args);
}

0 comments on commit f96c339

Please sign in to comment.