MCPcopy Create free account
hub / github.com/effect-app/libs / lazy

Function lazy

packages/effect-app/src/Function.ts:164–175  ·  view source on GitHub ↗
(f: () => A)

Source from the content-addressed store, hash-verified

162}
163
164export function lazy<A>(f: () => A): () => A {
165 let tmp: A | undefined
166 let done = false
167 return () => {
168 if (done) {
169 return tmp!
170 }
171 tmp = f()
172 done = true
173 return tmp
174 }
175}

Callers

nothing calls this directly

Calls 1

fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…