[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
0

Configure Feed

Select the types of activity you want to include in your feed.

chore: switch to setTimeout

Don't remember why yet.

+4 -3
+4 -3
packages/core/src/prompts/spinner.ts
··· 21 21 #startTime: number = 0; 22 22 #frameIndex: number = 0; 23 23 #indicatorTimer: number = 0; 24 - #intervalId: ReturnType<typeof setInterval> | undefined; 24 + #intervalId: ReturnType<typeof setTimeout> | undefined; 25 25 #delay: number; 26 26 #frames: string[]; 27 27 #cancelMessage: string; ··· 53 53 this.#indicatorTimer = 0; 54 54 55 55 if (Number.isFinite(this.#delay)) { 56 - this.#intervalId = setInterval(() => this.#onInterval(), this.#delay); 56 + this.#intervalId = setTimeout(() => this.#onInterval(), this.#delay); 57 57 } else { 58 58 this.render(); 59 59 } ··· 127 127 this.#exitCode = 0; 128 128 129 129 if (this.#intervalId) { 130 - clearInterval(this.#intervalId); 130 + clearTimeout(this.#intervalId); 131 131 this.#intervalId = undefined; 132 132 } 133 133 ··· 140 140 this.#frameIndex = this.#frameIndex + 1 < this.#frames.length ? this.#frameIndex + 1 : 0; 141 141 // indicator increase by 1 every 8 frames 142 142 this.#indicatorTimer = this.#indicatorTimer < 4 ? this.#indicatorTimer + 0.125 : 0; 143 + this.#intervalId = setTimeout(() => this.#onInterval(), this.#delay); 143 144 } 144 145 145 146 #onProcessError: () => void = () => {