Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg?q=fetch&page=191&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 11122 results for "fetch"(3197ms)

NPLLMChatRouteSingleColumn.tsx6 matches

@wolf•Updated 1 week ago
50 files={project.data?.files}
51 branchId={branchId}
52 refetch={project.refetch}
53 />
54 </ProjectContext>
60 files,
61 branchId,
62 refetch,
63}: {
64 project: any;
65 files: any[];
66 branchId: string;
67 refetch: () => void;
68}) {
69 const [images, setImages] = useState<(string|null)[]>([]);
94 if (!messages?.length) return;
95 let last = messages.at(-1);
96 if (shouldRefetch(last)) {
97 refetch();
98 }
99 }, [messages]);
177}
178
179function shouldRefetch (message) {
180 for (let i = 0; i < message?.parts?.length; i++) {
181 let part = message.parts[i];

NPLLMuseProject.tsx5 matches

@wolf•Updated 1 week ago
9 const [error, setError] = useState(null);
10
11 const fetchData = async () => {
12 try {
13 const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
17 if (branchId) filesEndpoint.searchParams.append("branchId", branchId);
18
19 const { project } = await fetch(projectEndpoint).then((res) =>
20 res.json()
21 );
22 const { files } = await fetch(filesEndpoint).then((res) => res.json());
23
24 setData({ project, files });
34 useEffect(() => {
35 if (!projectId) return;
36 fetchData();
37 }, [projectId, branchId]);
38
39 return { data, loading, error, refetch: fetchData };
40}
41

NPLLMuseBranches.tsx4 matches

@wolf•Updated 1 week ago
7 const [loading, setLoading] = useState(true);
8
9 const fetchData = async () => {
10 const endpoint = new URL(ENDPOINT, window.location.origin);
11 endpoint.searchParams.append("projectId", projectId);
12
13 const res = await fetch(endpoint)
14 .then(res => res.json());
15 setData(res.branches);
19 useEffect(() => {
20 if (!projectId) return;
21 fetchData();
22 }, [projectId]);
23
24 return { data, loading, refetch: fetchData };
25}

NPLLMuseCreateBranch.tsx1 match

@wolf•Updated 1 week ago
12 setData(null);
13 setError(null);
14 const res = await fetch(ENDPOINT, {
15 method: "POST",
16 body: JSON.stringify({

NPLLMuseCreateProject.tsx1 match

@wolf•Updated 1 week ago
19 setError(null);
20 try {
21 const res = await fetch(ENDPOINT, {
22 method: "POST",
23 headers: {

NPLLMuseProjects.tsx4 matches

@wolf•Updated 1 week ago
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const res = await fetch(ENDPOINT);
13 const data = await res.json();
14 if (!res.ok) {
32
33 useEffect(() => {
34 fetchData();
35 }, []);
36
37 return { data, loading, error, refetch: fetchData };
38}
39

NPLLMuseUser.tsx4 matches

@wolf•Updated 1 week ago
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const userEndpoint = new URL(USER_ENDPOINT, window.location.origin);
13
14 const res = await fetch(userEndpoint);
15 const data = await res.json();
16 if (!res.ok) {
33
34 useEffect(() => {
35 fetchData();
36 }, []);
37
38 return { data, loading, error, refetch: fetchData };
39}
40

NPLLMsend-message.ts3 matches

@wolf•Updated 1 week ago
106 }
107
108 // If there are selected files, fetch their content and add them to the messages
109 if (selectedFiles && selectedFiles.length > 0) {
110 const vt = new ValTown({ bearerToken });
126 fileContents += `## File: ${filePath}\n\`\`\`\n${fileWithLinesNumbers(content)}\n\`\`\`\n\n`;
127 } catch (error) {
128 console.error(`Error fetching file ${filePath}:`, error);
129 fileContents += `## File: ${filePath}\nError: Could not fetch file content\n\n`;
130 }
131 }

NPLLMproject-files.ts2 matches

@wolf•Updated 1 week ago
30 return c.json({ files: files.data });
31 } catch (error) {
32 console.error("Error fetching project files:", error);
33 return Response.json({ error: "Failed to fetch project files" }, { status: 500 });
34 }
35});

NPLLMproject-branches.ts2 matches

@wolf•Updated 1 week ago
21 return c.json({ branches: branches.data });
22 } catch (error) {
23 console.error("Error fetching branches:", error);
24 return Response.json({ error: "Failed to fetch branches" }, { status: 500 });
25 }
26});

fetch_template2 file matches

@gwoods22•Updated 17 hours ago

HN-fetch-call3 file matches

@ImGqb•Updated 1 day ago
fetch HackerNews by API