( rt: AtomClientRuntime, q: QueryFamilyDescriptor<I, A, E> )
| 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. |
| 123 | const queryFamilyByKey = new Map<string, any>() |
| 124 | const 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 |
no test coverage detected
searching dependent graphs…