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/$%7Burl%7D?q=fetch&page=31&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 8384 results for "fetch"(952ms)

Townieproject-branches.ts2 matches

@std•Updated 3 days 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});

TownieLayoutRoute.tsx1 match

@std•Updated 3 days ago
4
5export function LayoutRoute () {
6 // TODO fetch here because we're not doing any caching
7 // and we want the user data in the header ?
8 // const projects = useProjects();

Townieindex.ts1 match

@std•Updated 3 days ago
62});
63
64export default app.fetch;
65

Townieindex.ts1 match

@std•Updated 3 days ago
21
22// This is the entry point for HTTP vals
23export default app.fetch;
24

TownieChatRoute.tsx8 matches

@std•Updated 3 days ago
46 files={project.data?.files}
47 branchId={branchId}
48 refetch={project.refetch}
49 />
50 </>
56 files,
57 branchId,
58 refetch,
59}: {
60 project: any;
61 files: any[];
62 branchId: string;
63 refetch: () => void;
64}) {
65 const { token, anthropicApiKey } = useAuth();
93 if (!messages?.length) return;
94 let last = messages.at(-1);
95 if (shouldRefetch(last)) {
96 refetch();
97 }
98 }, [messages]);
177}
178
179function shouldRefetch (message) {
180 for (let i = 0; i < message?.parts?.length; i++) {
181 let part = message.parts[i];
184 case "str_replace_editor":
185 if (part.toolInvocation?.args?.command === "create") {
186 // console.log("REFETCH (create)");
187 return true;
188 }
190 case "delete_file":
191 case "change_val_type":
192 // console.log("REFETCH (change type or delete)");
193 return true;
194 }

TownieBranchSelect.tsx1 match

@std•Updated 3 days ago
33 return;
34 }
35 branches.refetch();
36 if (res?.branch?.id) {
37 navigate(`/chat/${projectId}/branch/${res.branch.id}`);

untitled-7166main.tsx1 match

@welfare•Updated 3 days ago
17
18 try {
19 const response = await fetch(proxyRequest);
20 return new Response(response.body, {
21 status: response.status,

eink-frame-remixweather.tsx1 match

@charmaine•Updated 3 days ago
46 </div>
47 )
48 : <div className="text-2xl mt-2.5">Unable to fetch weather data</div>}
49 </Content>
50 <Footer />

eink-frame-remixweather.ts2 matches

@charmaine•Updated 3 days ago
1import fetchWithCache from "./fetchWithCache.ts";
2
3export type WEATHER_FORECAST = {
39
40 // Cache for 30 minutes
41 const data: WEATHER_FORECAST = await fetchWithCache(apiUrl, cacheKey, 30).then((res) => res.json());
42 return new Response(JSON.stringify(data), {
43 headers: {

eink-frame-remixnews.ts2 matches

@charmaine•Updated 3 days ago
1import fetchWithCache from "./fetchWithCache.ts";
2
3const GUARDIAN_API_KEY = Deno.env.get("GUARDIAN_API_KEY");
25 const cacheKey = `guardian_headlines_${size}`;
26
27 const data = await fetchWithCache(apiUrl, cacheKey).then((res) => res.json());
28 return new Response(JSON.stringify(data), {
29 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago