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

Function withFallback

packages/effect/src/unstable/reactivity/Atom.ts:1458–1464  ·  view source on GitHub ↗
(get: AtomContext)

Source from the content-addressed store, hash-verified

1456 > =>
1457{
1458 function withFallback(get: AtomContext) {
1459 const result = get(self)
1460 if (result._tag === "Initial") {
1461 return AsyncResult.waiting(get(fallback))
1462 }
1463 return result
1464 }
1465 return isWritable(self)
1466 ? writable(
1467 withFallback,

Callers

nothing calls this directly

Calls 1

getFunction · 0.70

Tested by

no test coverage detected