MCPcopy Create free account
hub / github.com/dailydotdev/apps / prefetch

Function prefetch

packages/shared/src/hooks/usePostPrefetch.ts:54–61  ·  view source on GitHub ↗
(anchor: HTMLAnchorElement)

Source from the content-addressed store, hash-verified

52 }
53 const fetched = new Set<string>();
54 const prefetch = (anchor: HTMLAnchorElement) => {
55 const href = pathOf(anchor);
56 if (fetched.has(href)) {
57 return;
58 }
59 fetched.add(href);
60 router.prefetch(href).catch(() => undefined);
61 };
62 const onPress = (event: Event) => {
63 const anchor = pageLink(event.target);
64 if (anchor) {

Callers 2

onPressFunction · 0.70
usePostPrefetchFunction · 0.70

Calls 2

pathOfFunction · 0.85
prefetchMethod · 0.80

Tested by

no test coverage detected