(key: ReadonlyArray<unknown>, getReads: () => DataDependencies.DataDependencies)
| 98 | * invalidation target. Re-asserting the last-known reads on every (re)subscribe closes that gap, so the |
| 99 | * registry mirrors the live query even across cache-hit remounts. |
| 100 | */ |
| 101 | const trackReadDependencies = |
| 102 | (key: ReadonlyArray<unknown>, getReads: () => DataDependencies.DataDependencies) => |
| 103 | <A, E>(atom: Atom.Atom<AsyncResult.AsyncResult<A, E>>): Atom.Atom<AsyncResult.AsyncResult<A, E>> => |
| 104 | Atom.transform(atom, (get) => { |
| 105 | const reads = getReads() |
| 106 | if (DataDependencies.isNonEmpty(reads)) setQueryReadDependencies(key, reads) |
| 107 | get.addFinalizer(() => clearQueryReadDependencies(key)) |
| 108 | return get(atom) |
| 109 | }, { initialValueTarget: atom }) |
| 110 |
no test coverage detected
searching dependent graphs…