(key: string, fetching: boolean)
| 131 | } |
| 132 | |
| 133 | function setQueryFetching(key: string, fetching: boolean): void { |
| 134 | const wasFetching = cache.fetchingKeys.has(key) |
| 135 | if (fetching) cache.fetchingKeys.add(key) |
| 136 | else cache.fetchingKeys.delete(key) |
| 137 | |
| 138 | if (wasFetching !== fetching) { |
| 139 | // bust memo so snapshot changes even if entry didn’t |
| 140 | snapshotMemo.delete(key) |
| 141 | notifyKeyListeners(key) |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | function incrementRefCount(key: string): void { |
| 146 | const current = cache.refCounts.get(key) ?? 0 |
no test coverage detected