(def, args, fetcher, awaited)
| 6546 | }) |
| 6547 | |
| 6548 | const prefetch: CacheInternals["prefetch"] = (def, args, fetcher, awaited) => { |
| 6549 | if (disposed) return undefined |
| 6550 | const entry = ensureEntry(register(def), args) |
| 6551 | // Nothing under a live patch. |
| 6552 | if (hasLive(entry)) return undefined |
| 6553 | // A list that holds pages, stale ones included, isn't loaded again. |
| 6554 | if ( |
| 6555 | inWindow(entry) || !isStale(entry) || |
| 6556 | (entry.def.list !== undefined && |
| 6557 | entry.def.list.ops.heldPages(entry).length > 0) |
| 6558 | ) { |
| 6559 | resetIdle(entry) |
| 6560 | return undefined |
| 6561 | } |
| 6562 | if (entry.fetch !== undefined) entry.kept = true |
| 6563 | // A stream query's idle deadline runs while its stream opens, so it counts from the latest request. |
| 6564 | resetIdle(entry) |
| 6565 | ensureFetch(entry, "prefetch", buildOf(fetcher)) |
| 6566 | afterQuiet(entry) |
| 6567 | if (awaited !== true || !owesRefetch(entry)) return undefined |
| 6568 | let quiet = prefetchAwaits.get(entry) |
| 6569 | if (quiet === undefined) prefetchAwaits.set(entry, quiet = Deferred.makeUnsafe()) |
| 6570 | return Deferred.await(quiet) |
| 6571 | } |
| 6572 | |
| 6573 | const loadMore: CacheInternals["loadMore"] = ( |
| 6574 | def, |
nothing calls this directly
no test coverage detected