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=224&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 13579 results for "fetch"(2750ms)

ftApp.tsx9 matches

@newbienate•Updated 6 days ago
19
20 useEffect(() => {
21 // Load initial data from window or fetch from API
22 const initialData = (window as any).__INITIAL_DATA__;
23 if (initialData) {
25 setLoading(false);
26 } else {
27 fetchData();
28 }
29 }, []);
30
31 const fetchData = async () => {
32 try {
33 setLoading(true);
34 const [classesRes, membersRes, workoutsRes] = await Promise.all([
35 fetch('/api/classes'),
36 fetch('/api/members'),
37 fetch('/api/workouts')
38 ]);
39
46 setData({ classes, members, workouts });
47 } catch (error) {
48 console.error('Error fetching data:', error);
49 } finally {
50 setLoading(false);
54 const refreshClasses = async () => {
55 try {
56 const response = await fetch('/api/classes');
57 const classes = await response.json();
58 setData(prev => ({ ...prev, classes }));
64 const refreshMembers = async () => {
65 try {
66 const response = await fetch('/api/members');
67 const members = await response.json();
68 setData(prev => ({ ...prev, members }));

Mind_clinicindex.ts2 matches

@andym42•Updated 6 days ago
29 let html = await readFile("/frontend/index.html", import.meta.url);
30
31 // Fetch initial data to avoid extra round-trips
32 const [moodStats, recentMoods, recentJournals] = await Promise.all([
33 getMoodStats().catch(() => null),
58});
59
60export default app.fetch;

Mind_clinicJournal.tsx2 matches

@andym42•Updated 6 days ago
101 const method = editingEntry ? 'PUT' : 'POST';
102
103 const response = await fetch(url, {
104 method,
105 headers: { 'Content-Type': 'application/json' },
135
136 try {
137 const response = await fetch(`/api/journal/${id}`, {
138 method: 'DELETE'
139 });

Mind_clinicMoodTracker.tsx2 matches

@andym42•Updated 6 days ago
47 try {
48 const today = new Date().toISOString().split('T')[0];
49 const response = await fetch(`/api/mood/${today}`);
50 if (response.ok) {
51 const data = await response.json();
70
71 try {
72 const response = await fetch('/api/mood', {
73 method: 'POST',
74 headers: { 'Content-Type': 'application/json' },

Mind_clinicApp.tsx3 matches

@andym42•Updated 6 days ago
33 try {
34 const [statsRes, moodsRes] = await Promise.all([
35 fetch('/api/mood/stats'),
36 fetch('/api/mood/recent?limit=7')
37 ]);
38
53 const refreshJournalData = async () => {
54 try {
55 const response = await fetch('/api/journal?limit=5');
56 if (response.ok) {
57 const data = await response.json();

job-posting-and-chatroomindex.ts1 match

@Iyke•Updated 6 days ago
32app.get("/health", c => c.json({ status: "ok", timestamp: new Date().toISOString() }));
33
34export default app.fetch;

job-posting-and-chatroomChatRoom.tsx7 matches

@Iyke•Updated 6 days ago
17 };
18
19 const fetchMessages = async () => {
20 try {
21 const response = await fetch('/api/chat/messages');
22 if (!response.ok) throw new Error('Failed to fetch messages');
23 const messagesData = await response.json();
24 setMessages(messagesData);
26 } catch (err) {
27 setError('Failed to load messages');
28 console.error('Error fetching messages:', err);
29 } finally {
30 setLoading(false);
33
34 useEffect(() => {
35 fetchMessages();
36
37 // Auto-refresh messages every 5 seconds
38 const interval = setInterval(fetchMessages, 5000);
39 return () => clearInterval(interval);
40 }, []);
74 };
75
76 const response = await fetch('/api/chat/messages', {
77 method: 'POST',
78 headers: {

job-posting-and-chatroomJobForm.tsx1 match

@Iyke•Updated 6 days ago
28
29 try {
30 const response = await fetch('/api/jobs', {
31 method: 'POST',
32 headers: {

job-posting-and-chatroomJobBoard.tsx5 matches

@Iyke•Updated 6 days ago
10 const [error, setError] = useState<string | null>(null);
11
12 const fetchJobs = async () => {
13 try {
14 setLoading(true);
15 const response = await fetch('/api/jobs');
16 if (!response.ok) throw new Error('Failed to fetch jobs');
17 const jobsData = await response.json();
18 setJobs(jobsData);
20 } catch (err) {
21 setError('Failed to load job postings');
22 console.error('Error fetching jobs:', err);
23 } finally {
24 setLoading(false);
27
28 useEffect(() => {
29 fetchJobs();
30 }, []);
31

job-posting-and-chatroomchat.ts2 matches

@Iyke•Updated 6 days ago
11 return c.json(messages);
12 } catch (error) {
13 console.error("Error fetching messages:", error);
14 return c.json({ error: "Failed to fetch messages" }, 500);
15 }
16});

FetchBasic2 file matches

@ther•Updated 8 hours ago

GithubPRFetcher

@andybak•Updated 3 days ago