function once once<T>(fn: () => T): (() => T) Lazy evaluation - compute once on first call, cache forever. Use instead of let x = null; const getX = () => x ??= compute(); Type Parameters T Parameters fn: () => T Return Type (() => T)