We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 63804b8 commit 7e6dc7dCopy full SHA for 7e6dc7d
src/shared/cli/startLineWithDots.ts
@@ -1,6 +1,7 @@
1
import readline from "readline";
2
3
export function startLineWithDots(line: string) {
4
+ const timer = [setTimeout(tick, 500)];
5
let dots = 0;
6
let lastLogged!: string;
7
@@ -21,17 +22,17 @@ export function startLineWithDots(line: string) {
21
22
return toLog;
23
}
24
- writeLine();
25
-
26
- const timer = setInterval(() => {
+ function tick() {
27
clearLine();
28
writeLine();
29
- dots += 1;
30
- }, 500);
+ timer[0] = setTimeout(tick, 500);
+ }
+
31
+ writeLine();
32
33
return () => {
34
- clearInterval(timer);
35
+ clearInterval(timer[0]);
36
return lastLogged.length;
37
};
38
0 commit comments