summaryrefslogtreecommitdiff
path: root/js/timers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/timers.ts')
-rw-r--r--js/timers.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/timers.ts b/js/timers.ts
index 0d0e1e69a..7cac5cc6d 100644
--- a/js/timers.ts
+++ b/js/timers.ts
@@ -249,7 +249,7 @@ export function setInterval(
}
/** Clears a previously set timer by id. AKA clearTimeout and clearInterval. */
-export function clearTimer(id: number): void {
+function clearTimer(id: number): void {
id = Number(id);
const timer = idMap.get(id);
if (timer === undefined) {
@@ -260,3 +260,11 @@ export function clearTimer(id: number): void {
unschedule(timer);
idMap.delete(timer.id);
}
+
+export function clearTimeout(id: number): void {
+ clearTimer(id);
+}
+
+export function clearInterval(id: number): void {
+ clearTimer(id);
+}