mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Include codemirror libs for svelte
This commit is contained in:
parent
c663785264
commit
a3fef552bd
2 changed files with 4 additions and 2 deletions
|
@ -22,6 +22,8 @@ compile_svelte(
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//ts/components",
|
"//ts/components",
|
||||||
|
"@npm//@types/codemirror",
|
||||||
|
"@npm//codemirror",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
export class ChangeTimer {
|
export class ChangeTimer {
|
||||||
private value: number | null = null;
|
private value: number | null = null;
|
||||||
|
|
||||||
schedule(action: () => void, delay: number) {
|
schedule(action: () => void, delay: number): void {
|
||||||
this.clear();
|
this.clear();
|
||||||
this.value = setTimeout(action, delay);
|
this.value = setTimeout(action, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
clear(): void {
|
||||||
if (this.value) {
|
if (this.value) {
|
||||||
clearTimeout(this.value);
|
clearTimeout(this.value);
|
||||||
this.value = null;
|
this.value = null;
|
||||||
|
|
Loading…
Reference in a new issue