* Stops the spinner. * * @example Usage * ```ts ignore * import { Spinner } from "@std/cli/unstable-spinner"; * * const spinner = new Spinner({ message: "Loading..." }); * spinner.start(); * * setTimeout(() => { * spinner.stop(); * console.log("Finished loading!");
()
| 259 | * ``` |
| 260 | */ |
| 261 | stop() { |
| 262 | if (this.#intervalId === null) return; |
| 263 | clearInterval(this.#intervalId); |
| 264 | this.#intervalId = null; |
| 265 | this.#output.writeSync(LINE_CLEAR); // Clear the current line |
| 266 | } |
| 267 | } |
no test coverage detected