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

Function makeAtomClientRuntime

packages/vue/src/atomQuery.ts:195–202  ·  view source on GitHub ↗
(
  getContext: () => Layer.Layer<R, never, never>,
  memoMap: Layer.MemoMap
)

Source from the content-addressed store, hash-verified

193 self: Atom.Atom<AsyncResult.AsyncResult<A, E>>
194): Atom.Atom<AsyncResult.AsyncResult<A, E>> =>
195 Atom.transform(self, (get) => {
196 const next = get(self)
197 if (next._tag !== "Success") return next
198 const prev = Option.flatMap(get.self<AsyncResult.AsyncResult<A, E>>(), AsyncResult.value)
199 if (Option.isNone(prev)) return next
200 const shared = replaceEqualDeep(prev.value, next.value)
201 return shared === next.value
202 ? next
203 : AsyncResult.success(shared, { waiting: next.waiting, timestamp: next.timestamp })
204 }, { initialValueTarget: self })
205

Callers 7

getAtomRtFunction · 0.90
query-span.test.tsFile · 0.85
makeAtomHarnessFunction · 0.85
makeEnvFunction · 0.85

Calls 2

factoryFunction · 0.85
contextMethod · 0.65

Tested by 2

makeAtomHarnessFunction · 0.68
makeEnvFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…