MCPcopy Create free account
hub / github.com/denoland/std / updateFrame

Method updateFrame

cli/unstable_spinner.ts:226–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224
225 // Updates the spinner after the given interval.
226 const updateFrame = () => {
227 const color = this.#color ?? "";
228 const frame = encoder.encode(
229 noColor
230 ? this.#spinner[i] + " " + this.message
231 : color + this.#spinner[i] + COLOR_RESET + " " + this.message,
232 );
233 // call writeSync once to reduce flickering
234 const writeData = new Uint8Array(LINE_CLEAR.length + frame.length);
235 writeData.set(LINE_CLEAR);
236 writeData.set(frame, LINE_CLEAR.length);
237 this.#output.writeSync(writeData);
238 i = (i + 1) % this.#spinner.length;
239 };
240
241 this.#intervalId = setInterval(updateFrame, this.#interval);
242 updateFrame();

Callers

nothing calls this directly

Calls 2

setMethod · 0.65
writeSyncMethod · 0.65

Tested by

no test coverage detected