MCPcopy Create free account
hub / github.com/Effect-TS/effect / lazy

Function lazy

packages/effect/src/ui/Query.ts:2404–2407  ·  view source on GitHub ↗
(make: () => A)

Source from the content-addressed store, hash-verified

2402}
2403
2404const lazy = <A>(make: () => A): () => A => {
2405 let made: { readonly value: A } | undefined
2406 return () => (made ??= { value: make() }).value
2407}
2408
2409/**
2410 * Whether a type names `undefined`: `Schema.optional` and `Schema.UndefinedOr`

Callers 2

dropUndefinedOfFunction · 0.70
makeDefFunction · 0.70

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected