fix type error
This commit is contained in:
parent
affa7c1af8
commit
0ed6058139
|
|
@ -18,7 +18,7 @@ export class FolkMetronome extends HTMLElement {
|
||||||
this.addEventListener('click', this);
|
this.addEventListener('click', this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#timeoutId: NodeJS.Timeout | -1 = -1;
|
#timeoutId: number = -1;
|
||||||
|
|
||||||
get isPlaying() {
|
get isPlaying() {
|
||||||
return this.#timeoutId !== -1;
|
return this.#timeoutId !== -1;
|
||||||
|
|
@ -49,7 +49,7 @@ export class FolkMetronome extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
play() {
|
play() {
|
||||||
this.#timeoutId = setInterval(() => {
|
this.#timeoutId = window.setInterval(() => {
|
||||||
this.#updateBeat(this.#beat + 1);
|
this.#updateBeat(this.#beat + 1);
|
||||||
this.dispatchEvent(new Event('beat'));
|
this.dispatchEvent(new Event('beat'));
|
||||||
}, this.#intervalMs);
|
}, this.#intervalMs);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue