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/?q=fetch&page=16&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 2392 results for "fetch"(320ms)

EmailAttachmentLogindex.ts2 matches

@wolf•Updated 4 days ago
67});
68
69// Export the fetch handler
70export default app.fetch;

EmailAttachmentLogApp.tsx4 matches

@wolf•Updated 4 days ago
39
40 useEffect(() => {
41 const fetchAttachments = async () => {
42 try {
43 const response = await fetch("/api/attachments");
44 if (!response.ok) {
45 throw new Error("Failed to fetch attachments");
46 }
47 const data = await response.json();
54 };
55
56 fetchAttachments();
57 }, []);
58

fiberplaneHonoZodStarterindex.ts1 match

@crisscrossed•Updated 4 days ago
105});
106
107export default app.fetch;

EmailAttachmentLogindex.ts2 matches

@wolf•Updated 4 days ago
56});
57
58// Export the fetch handler
59export default app.fetch;

EmailAttachmentLogApp.tsx4 matches

@wolf•Updated 4 days ago
67 }
68
69 // Fetch attachments
70 fetch('/api/attachments')
71 .then(response => {
72 if (!response.ok) {
73 throw new Error('Failed to fetch attachments');
74 }
75 return response.json();
80 })
81 .catch(err => {
82 console.error('Error fetching attachments:', err);
83 setError('Failed to load attachments');
84 setLoading(false);

statusmonitor2 matches

@crisscrossed•Updated 4 days ago
15 const start = performance.now();
16 try {
17 res = await fetch(url);
18 end = performance.now();
19 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 }

templateTwitterAlertmain.tsx1 match

@fredmoon•Updated 4 days ago
19 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
20
21 // Fetch and log tweets
22 const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
23 console.log("Response from socialDataSearch:", response);

stevensDemosendDailyBrief.ts1 match

@ziipo•Updated 4 days ago
135 const lastSunday = today.startOf("week").minus({ days: 1 });
136
137 // Fetch relevant memories using the utility function
138 const memories = await getRelevantMemories();
139

stevensDemoNotebookView.tsx12 matches

@ziipo•Updated 4 days ago
67 const [currentPage, setCurrentPage] = useState(1);
68
69 const fetchMemories = useCallback(async () => {
70 setLoading(true);
71 setError(null);
72 try {
73 const response = await fetch(API_BASE);
74 if (!response.ok) {
75 throw new Error(`HTTP error! status: ${response.status}`);
78 setMemories(data);
79 } catch (e) {
80 console.error("Failed to fetch memories:", e);
81 setError(e.message || "Failed to fetch memories.");
82 } finally {
83 setLoading(false);
86
87 useEffect(() => {
88 fetchMemories();
89 }, [fetchMemories]);
90
91 const handleAddMemory = async (e: React.FormEvent) => {
100
101 try {
102 const response = await fetch(API_BASE, {
103 method: "POST",
104 headers: { "Content-Type": "application/json" },
112 setNewMemoryTags("");
113 setShowAddForm(false);
114 await fetchMemories();
115 } catch (e) {
116 console.error("Failed to add memory:", e);
123
124 try {
125 const response = await fetch(`${API_BASE}/${id}`, {
126 method: "DELETE",
127 });
129 throw new Error(`HTTP error! status: ${response.status}`);
130 }
131 await fetchMemories();
132 } catch (e) {
133 console.error("Failed to delete memory:", e);
155
156 try {
157 const response = await fetch(`${API_BASE}/${editingMemory.id}`, {
158 method: "PUT",
159 headers: { "Content-Type": "application/json" },
164 }
165 setEditingMemory(null);
166 await fetchMemories();
167 } catch (e) {
168 console.error("Failed to update memory:", e);

stevensDemoindex.ts2 matches

@ziipo•Updated 4 days ago
135 ));
136
137// HTTP vals expect an exported "fetch handler"
138export default app.fetch;

fetchPaginatedData2 file matches

@nbbaier•Updated 4 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago