Skip to content

Lazy

Lazy<A> = object

Defined in: Core/Lazy.ts:16

A synchronous memoized computation. The factory function runs exactly once — on the first call to Lazy.evaluate — and the result is cached for all subsequent calls.

const config = Lazy.from(() => parseConfig(rawInput));

pipe(
  config,
  Lazy.map(cfg => cfg.port),
  Lazy.evaluate,
); // parseConfig ran once; cfg.port returned

A

readonly get: () => A

Defined in: Core/Lazy.ts:16

A