MCPcopy Create free account
hub / github.com/Fernanda-Kipper/text-editor / useFile

Function useFile

src/hooks/useFile.ts:17–31  ·  view source on GitHub ↗
(slug?: string)

Source from the content-addressed store, hash-verified

15 .then(res => res.data.data);
16
17export function useFile(slug?: string) {
18 const { data, isLoading, isError } = useQuery(
19 ['file', slug],
20 () => fetcher(generateCreatorQuery(slug ?? "")),
21 {
22 enabled: !!slug
23 }
24 );
25
26 return {
27 data: data?.file,
28 isLoading,
29 isError
30 }
31}

Callers 1

EditorFunction · 0.90

Calls 2

fetcherFunction · 0.70
generateCreatorQueryFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…