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

Function getQueryFamily

packages/vue/src/query.ts:120–131  ·  view source on GitHub ↗
(
  rt: AtomClientRuntime,
  q: QueryFamilyDescriptor<I, A, E>
)

Source from the content-addressed store, hash-verified

118
119// One atom family per request shape, keyed by the stable query key + projection hash (not the
120// handler object — `clientFor` returns a fresh proxy per call, so the object isn't shareable).
121// Module-level + key-indexed => the family is process-global, so the same request+input read
122// the same atom across components/pages => cross-page caching via the global registry.
123const queryFamilyByKey = new Map<string, any>()
124const getQueryFamily = <I, A, E>(
125 rt: AtomClientRuntime,
126 q: QueryFamilyDescriptor<I, A, E>
127): QueryAtomFamily<I, A, E> => {
128 const key = queryFamilyCacheKey(q)
129 let f = queryFamilyByKey.get(key)
130 if (!f) {
131 f = buildQueryFamily(rt, q)
132 queryFamilyByKey.set(key, f)
133 }
134 return f

Callers 3

queryAtomForFunction · 0.85
makeQueryViewFunction · 0.85
useQueryFamilyFunction · 0.85

Calls 4

buildQueryFamilyFunction · 0.90
queryFamilyCacheKeyFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…