MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / lazy

Function lazy

frontend/util/util.ts:250–259  ·  view source on GitHub ↗
(callback: T)

Source from the content-addressed store, hash-verified

248 * @returns The result of the function.
249 */
250const lazy = <T extends (...args: any[]) => any>(callback: T) => {
251 let res: ReturnType<T>;
252 let processed = false;
253 return (...args: Parameters<T>): ReturnType<T> => {
254 if (processed) return res;
255 res = callback(...args);
256 processed = true;
257 return res;
258 };
259};
260
261/**
262 * Generates an external link by appending the given URL to the "https://extern?" endpoint.

Callers 4

computeMoveNodeFunction · 0.90
isdev.tsFile · 0.90
endpoints.tsFile · 0.90
preview.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected